November 20, 2008 at 3:39 am
Hi, I often have situations where a lot of queries time out. However most queries time out because they are blocked by other long running queries, rather than themselves taking a long time to run (due to table scans etc). Is there any way to get SQL profiler to indicate only those queries that have long durations only as a result of themselves taking a long time to run, rather than spending all their time blocked?
Thanks
http://90.212.51.111 domain
November 20, 2008 at 7:49 am
I don't believe that there is a way to do that directly in profiler. I think you could figure that out by using a combination of the lock timeout event and the CPU and duration columns of the SP:Completed or SQL:StmtCompleted events as I do not believe a process waiting for a lock to be released is using CPU time.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
November 27, 2008 at 4:47 am
just a point here - generally queries only time out from the client dropping the connection not as an internal SQL Server operation unless it's a deadlock. If you set a block using a couple of sql queries you'll find they'll tend to sit there until the end of time.
I run a profiler which captures long running queries based upon duration, but you won't really know a query is long running until it's finished.
It's not difficult to query the dmvs to gather what you need either but sorting out waht's blocked and just running may be trickier
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply