Client from their production environment send me a trace file. I want to know which stored procedures are taking longest.
The things they record in the trace file include: RPC:Starting , RPC:Completed
I noticed in in the trace columns we have both StartTime/EndTime
and also Duration
.
Which one should I use for my purpose?
And to know how long a SP took, so Should I find the difference between StartTime
of RPC:Starting
and EndTime
of RPC:Completed
?
If it helps, you can run the Stored Procedure using the Display Estimated Execution Plain (CTRL + L) tool contained in SQL Management Studio.
It will demonstrate the cost of time and execution of each.
I hope I have helped.