|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using Trace OutputI have a huge stored procedure (2000 lines) written by someone who has left, and we need to optimize it. This stored procedure uses Global Temporary Tables. Occasionally we get a timeout error, when this stored procedure is executing. We put in Lumigent’s Log explorer and found out we are getting deadlocks multiple times as day. I have run the trace and looked at it when the stored procedure in question is run. Is the duration in Milliseconds? When I subtract the Start Time of a SP:StmtCompleted from the Start Time of the corresponding SP:StmtStarting, it is not the same as the Duration, Why? How can I use this information from the trace, to determine where the lock is happening? Thanks in Advance, Laurence Nuttall Programmer Analyst III UCLA - Division of Continuing Education You can capture lock events in SQL profiler. Under events selection
when you're setting up a trace, select the Lock:Deadlock and Lock:Deadlock Chain events Duration is indeed in ms. Hope that helps! Larry wrote:
Show quote > We are on SQL Server 2000. The duration is only accurate to about 15ms. If you want to use a high > I have a huge stored procedure (2000 lines) written by someone who has > left, and we need to optimize it. > This stored procedure uses Global Temporary Tables. > > Occasionally we get a timeout error, when this stored procedure is > executing. > We put in Lumigent’s Log explorer and found out we are getting > deadlocks multiple times as day. > > I have run the trace and looked at it when the stored procedure in > question is run. > > Is the duration in Milliseconds? > > When I subtract the Start Time of a SP:StmtCompleted from the > Start Time of the corresponding SP:StmtStarting, it is not the same > as the Duration, > > Why? > How can I use this information from the trace, to determine where the > lock is happening? > > Thanks in Advance, > > Laurence Nuttall > Programmer Analyst III > UCLA - Division of Continuing Education resolution timer (in development) you can download one from http://sqldev.net/. |
|||||||||||||||||||||||