Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Trace Duration in -ve Expand / Collapse
Author
Message
Posted Tuesday, May 6, 2014 11:39 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, September 16, 2014 2:11 AM
Points: 336, Visits: 1,155
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??
Post #1568283
Posted Wednesday, May 7, 2014 4:39 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:01 AM
Points: 14,029, Visits: 28,404
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
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1568365
Posted Wednesday, May 7, 2014 4:59 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, September 16, 2014 2:11 AM
Points: 336, Visits: 1,155
-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.
Post #1568376
Posted Wednesday, May 7, 2014 5:39 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:01 AM
Points: 14,029, Visits: 28,404
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
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1568394
Posted Wednesday, May 7, 2014 6:46 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Today @ 7:15 AM
Points: 675, Visits: 6,814
Probably a rounding error.
Could also be server synching time with domain controller, if this happened between start and end of trace.
Post #1568429
Posted Wednesday, May 7, 2014 11:39 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, September 16, 2014 2:11 AM
Points: 336, Visits: 1,155
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 ?
Post #1568625
Posted Wednesday, May 7, 2014 12:08 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 11:19 AM
Points: 40,428, Visits: 36,878
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 2008, MVP
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

Post #1568637
Posted Wednesday, May 7, 2014 12:19 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:01 AM
Points: 14,029, Visits: 28,404
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
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1568642
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse