10 Expensive Queries For the Last Week

SQL Server performance monitoring and alerting

Moderators: eddie davis, priyasinha, Adam, chriskelly, Chris Lambrou, Chris Spencer

10 Expensive Queries For the Last Week

Postby UnicornsRreal » Thu Jan 26, 2012 12:53 pm


Is there away to get the most expensive queries for the last 7 days every hour?

Can this be pulled from the database some how?
Posts: 5
Joined: Fri May 27, 2011 11:47 am

Postby Chris Spencer » Thu Jan 26, 2012 3:00 pm


The repository is not documented sorry but it should be possible to get information from the following three views.


The function utils.TicksToDateTime() can be used to filter by date. Using something like this:

Code: Select all
WHERE utils.TicksToDateTime(data.Cluster_SqlServer_TopQueries_Instances_View.IdCollectionDate) > DATEADD(day, -7, GETDATE())

It might take a bit of experimentation to get this working.

Chris Spencer
Test Engineer
Red Gate
Chris Spencer
Posts: 301
Joined: Tue Aug 29, 2006 9:09 am
Location: Red Gate - Cambridge

Return to SQL Monitor 2

Who is online

Users browsing this forum: No registered users and 0 guests