Re: Profiler: Duration vs Difference between StartTime and EndTime

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



EndTime - StartTime is generally much more accurate than reported duration. I am not certain how duration is calculated, but I regularly see numbers that are wildly inaccurate. I still use it, though, simply because it's quicker to look at and can be filtered :-)


--

Adam Machanic
SQL Server MVP - http://sqlblog.com

Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220



"Mark" <marksullivan@xxxxxxx> wrote in message news:OPMWsT9HIHA.4880@xxxxxxxxxxxxxxxxxxxxxxx
I was running a profile trace for a client SQL Server 2005 Standard Edition, SP2. The duration for some of the statements was just under 1 minute, however for the same statements the difference between the starttime and endtime were closer to 17 ms.

Which one of these are more accurate? I saw in another posting that duration was actual time.

If duration is actual time how is it calculated?

Mark


.



Relevant Pages

  • Re: Need help from Gurus: Profiler columns
    ... DATEDIFF counts boundaries, not actual interval. ... endtime is inside the same second, DATEDIFF returns 0, but if the starttime ... and endtime are in different seconds, then you will get a non-zero answer. ... Duration is in microseconds, by the way, but you can look for equivalancies ...
    (microsoft.public.sqlserver.tools)
  • Re: Need help from Gurus: Profiler columns
    ... ORDER BY Duration DESC ... So, if the starttime ... and endtime is inside the same second, DATEDIFF returns 0, but if the ... equivalancies by the following query. ...
    (microsoft.public.sqlserver.tools)
  • Re: Counting Time overlap periods
    ... SELECT EventId, DATEDIFFAS Duration ... AS StartTime, MAX(EndTime) AS EndTime ...
    (microsoft.public.sqlserver.programming)
  • Re: Need help from Gurus: Profiler columns
    ... if you want to see the variance between DATEDIFF and duration you ... DATEDIFF counts boundaries, not actual interval. ... endtime is inside the same second, DATEDIFF returns 0, but if the ... starttime and endtime are in different seconds, ...
    (microsoft.public.sqlserver.tools)
  • Re: Need help from Gurus: Profiler columns
    ... WHERE TextData IS NOT NULL ... ORDER BY Duration DESC ... DATEDIFF counts boundaries, not actual interval. ... and endtime is inside the same second, DATEDIFF returns 0, but if the ...
    (microsoft.public.sqlserver.tools)