Question about duration

  • 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?

  • 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.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • 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