Long running query...query

Monitor, diagnose and receive alerts to problems across your SQL Servers.

Long running query...query

Postby TedMaulUK » Thu Jul 08, 2010 8:21 am


I've had a quick search and haven't found an answer so apols. if there's one out there...

I have a query regarding the Long Running Query alert, in particular the 'Was running for:' value.

I have left the 'Query running for longer than' at the default 10s so I would expect the alert to to be raised shortly after the 10s threshold has been reached for any given query.

Instead, for all instances of this alert on the server I'm monitoring ithe 'Was running for' is always circa 45s

Why isn't the alert triggered at, say, 11 seconds? I've increased the 'Query running for longer than' to 30s and, as I would expect, am seeing the same results.

Is the alert only triggered once the query has finished executing or is there something else that determines it?

Thanks in advance

Posts: 1
Joined: Thu Jul 08, 2010 8:09 am

Postby james.billings » Fri Jul 09, 2010 2:34 pm


The alert won't occur immediately after the time set - all that controls is how long the query must be running before it generates an alert.

The actual polling frequency is configured via an XML file (if you do want to change it - bearing in mind more frequent polling may affect server performance).

If you look for "config.xml" (mine is in C:\\Program Files (x86)\\Red Gate\\SQL Response 1\\Alert Repository) you'll see a line containing:

- <!-- This will affect the polling frequency for these alerts; Long running query and Blocked SQL Process - setting to every 45 seconds

This means that the check will be made every 45 seconds; which is why the alert occurs in the way you see. i.e. the query lasted longer than 10 seconds so will trigger the alert, and was still going after 45 seconds, so you get that in the alert detail.

Hope that helps.
Posts: 1122
Joined: Wed Jun 16, 2010 10:10 am
Location: Red Gate

Return to SQL Monitor Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests