Long running query...query

TedMaulUKTedMaulUK Posts: 4 Bronze 1
edited July 9, 2010 10:34AM in SQL Monitor Previous Versions
Hi,

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

Ted

Comments

  • James BJames B Posts: 1,124 Silver 4
    Hi,

    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
    -->
    <SysProcessesTime>45</SysProcessesTime>

    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.
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.