August 11, 2011 at 12:54 pm
after enabling SET STATISTICS TIME ON I get this info about a query:
SQL Server Execution Times:
CPU time = 63 ms, elapsed time = 234 ms.
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
But in fact, if I use CURRENT_TIMESTAMPs, the query neds 6656 ms to execute (and that is accurate).
The query returns just 1 row, how the difference between ~ 8 seconds and ~ 0.25 seconds can be explained? If waits are involved, is there any way to see what kind of waits they are, or just the statistics information reported are plain wrong?
August 11, 2011 at 1:18 pm
Include Action Execution plan in SSMS (check under Query). Often time, execution times can be explained by the way the SQL Server db engine decides to do similar queries in different ways.
One thing to note. If you're using the same query and getting different plans each time you run it, there's something wrong with your plan caching.
EDIT: Did I say Action Execution plan? I meant Actual Execution Plan.
August 11, 2011 at 1:36 pm
most likely blocking or network wait or local processing wait.
I use profiler for this, much more accurate.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply