SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Trace Duration in -ve


Trace Duration in -ve

Author
Message
yuvipoy
yuvipoy
SSCertifiable
SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)

Group: General Forum Members
Points: 6193 Visits: 1497
Will the SQL server profiler trace duration value will be in -ve?

here is the one i got
Duration Starttime Endtime
-43 2014-05-06 22:26:07.887 2014-05-06 22:26:07.843

how it is possible??
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)

Group: General Forum Members
Points: 223317 Visits: 33564
What do you mean by "-ve"?

And you're right, a negative duration is not really possible. The actual capture of trace events is in microseconds and the GUI in Profiler displays in milliseconds. I have seen that conversion lead to problems. You can change the Profiler GUI to work with microseconds in the options.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
yuvipoy
yuvipoy
SSCertifiable
SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)

Group: General Forum Members
Points: 6193 Visits: 1497
-ve --> negative.I got the negative value in one of my statement.
If you see the duration which i have provided is in milliseconds and thats too 43 millisecond.
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)

Group: General Forum Members
Points: 223317 Visits: 33564
So, it's probably a rounding error. The capture of events in trace is in microseconds. Your display is milliseconds.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Greg Edwards-268690
Greg Edwards-268690
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10905 Visits: 8765
Probably a rounding error.
Could also be server synching time with domain controller, if this happened between start and end of trace.
yuvipoy
yuvipoy
SSCertifiable
SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)SSCertifiable (6.2K reputation)

Group: General Forum Members
Points: 6193 Visits: 1497
Grant Fritchey (5/7/2014)
So, it's probably a rounding error. The capture of events in trace is in microseconds. Your display is milliseconds.


Then how to rely on it ?
GilaMonster
GilaMonster
SSC Guru
SSC Guru (553K reputation)SSC Guru (553K reputation)SSC Guru (553K reputation)SSC Guru (553K reputation)SSC Guru (553K reputation)SSC Guru (553K reputation)SSC Guru (553K reputation)SSC Guru (553K reputation)

Group: General Forum Members
Points: 553297 Visits: 47744
SQL doesn't use high-precision timers (too resource intensive). Inaccuracy in the order of a few ms is not a problem. Like most rounding issues, the large numbers are accurate enough and a couple ms here or there is not going to skew performance tests, because you should take multiple tests and average.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)SSC Guru (223K reputation)

Group: General Forum Members
Points: 223317 Visits: 33564
Everything Gail said, plus, remember it does capture the values in microseconds. Just change the display to use those instead of milliseconds and you'll see fewer issues.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search