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 «««23456

Identifying Queries Running Slower Than Normal Expand / Collapse
Author
Message
Posted Thursday, August 14, 2008 8:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, September 5, 2013 3:23 AM
Points: 4, Visits: 37
I had to add

END
GO

to the end of the code too. It appears to be missing on the web page.
Post #552718
Posted Thursday, August 14, 2008 8:14 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 4:15 PM
Points: 31,210, Visits: 15,654
END added to the code.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #552730
Posted Sunday, August 17, 2008 11:27 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Saturday, October 25, 2014 8:06 AM
Points: 48, Visits: 845
Hi,

from the feedback, I’m not sure if people have understood this article completely.

The article discusses how to identify queries that are running slower than normal i.e. ones that seem to have degraded in performance. It is not about finding slow queries per se.

If you want to discover which queries are taking the longest to run (in terms of duration or IO), look at the sections entitled “Costly Queries by CPU”, and “Costly Queries by I/O”, in my MSDN article here: http://msdn.microsoft.com/en-us/magazine/cc135978.aspx

Thanks
Ian


Post #554005
Posted Wednesday, August 20, 2008 9:28 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 6:45 AM
Points: 5,430, Visits: 10,104
Good article, Ian. Ignore those ignorant enough to criticise without giving a reason. And to those who carp about bugs in the code, I say this: Debug it yourself! You'll learn by doing this. Incorrect syntax? Use Books Online to find out what the correct syntax is. Divide by zero error? Put in your own CASE statement to stop this. Carriage returns lost when copying and pasting? Put them back in. Honestly, whenever I post code I'm half tempted to put deliberate errors in it so that people don't just copy it and use it without thinking about it.

John
Post #555875
Posted Wednesday, September 24, 2008 2:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, January 14, 2009 2:47 AM
Points: 1, Visits: 3
I created the proc and executed it. Got the following:

Msg 8134, Level 16, State 1, Procedure dba_QueryTimeDelta, Line 25
Divide by zero error encountered.
The statement has been terminated.

(0 row(s) affected)

(0 row(s) affected)

Any quick fixes available?
Nick
Post #574964
Posted Wednesday, October 29, 2008 9:22 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, January 20, 2012 4:42 PM
Points: 5, Visits: 38
For a SQL 2000 tool google sp_who_3 written by Mike Barzilli.
Post #594068
Posted Monday, September 28, 2009 12:33 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 10:58 AM
Points: 246, Visits: 65
Same here. I've ensured that the code pasted correctly, there are no bad characters and so on. But I'm also getting a divide by zero error - I'm assuming this in the first CASE statement, but I don't have time to debug that right now. Interesting concept, though.


Buck Woody
MCDBA, MCSE, Novell and Sun Certified
Post #794681
Posted Monday, September 28, 2009 12:38 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Saturday, October 25, 2014 8:06 AM
Points: 48, Visits: 845
Hi,

please see a previous discussion entry by jacroberts, he has the relevant code to prevent the divide by zero error.

thanks
Ian
Post #794684
« Prev Topic | Next Topic »

Add to briefcase «««23456

Permissions Expand / Collapse