Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Profiler, Duration and Start/Stop Times

Author  Topic 

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2007-08-14 : 19:20:43
Profiler was run against a database looking for "long running" queries. I used the Duration column to filter out the queries that I didn't want. When reviewing the output, I noticed that for some queries the StartTime was equal to the EndTime even though the Duration was set higher.
My question is, "What can account for this discrepancy and what inferences should I draw about the difference?"
Does the difference represent a resouce being locked or some other type of blocking (Duration) and once the query was allowed to run, it completed quickly?
TIA

=======================================
If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy. -James Madison, fourth US president (1751-1836)

pootle_flump

1064 Posts

Posted - 2007-08-15 : 04:39:34
Does this from BoL make sense of it?

quote:
Note:
In SQL Server 2005, the server reports the duration of an event in microseconds (one millionth, or 10-6, of a second) and the amount of CPU time used by the event in milliseconds (one thousandth, or 10-3, of a second). In SQL Server 2000, the server reported both duration and CPU time in milliseconds. In SQL Server 2005, the SQL Server Profiler graphical user interface displays the Duration column in milliseconds by default, but when a trace is saved to either a file or a database table, the Duration column value is written in microseconds.

Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2007-08-16 : 12:18:42
Thanks for the reply; I do appreciate it.

I have already accounted and adjusted for the different units of measure. For the most part, the adjusted Duration is equal to the difference between StartTime and EndTime. It is when there is a wide variance between the adjusted Duration and the time difference that is my concern.

The Duration will show that the query took a half second to complete but the Start and End Times indicate that it was instantaneous. I'm trying to discern why the discrepancy exists and what evil it portends.

I've done some research into this issue without much (any?) success. My hope is that the level of erudition at this site will be able to shed some light.

=======================================
If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy. -James Madison, fourth US president (1751-1836)
Go to Top of Page
   

- Advertisement -