简体   繁体   中英

SQL Server Profiler Trace: finding Stored Procedures that are slow(est) and resource-consuming

I am running a few traces capturing specifically these 2 events:

RPC:Completed
SP:StmtCompleted

But what concerns me is that when I later analyze the trace data (querying table, aggregating, etc..), is that I may not be summarizing correct metrics. Because for example, for ONE RECORD for RPC:Completed event there may be 3 records for SP:StmtCompleted event, right?

So for example DURATION value may be recorded four times in such case for same SP EXEC but in my analysis I will be summarizing all four? Which seems incorrect. Because for one EXEC <SPname> (RPC:Completed) the trace may contain many rows related to the same occurrence of EXEC this SP if there is a certain number of SQL Statements executed in it.

Should I then NOT be using the SP:StmtCompleted event, not to mess up my analysis/metrics of performance?

RPC:Completed encompasses SP:StmtCompleted. You need to use one or the other.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM