Red Gate forums :: View topic - 10 Expensive Queries For the Last Week
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Monitor 2
SQL Monitor 2 forum

10 Expensive Queries For the Last Week

Search in SQL Monitor 2 forum
Post new topic   Reply to topic
Jump to:  
Author Message
UnicornsRreal



Joined: 27 May 2011
Posts: 5

PostPosted: Thu Jan 26, 2012 12:53 pm    Post subject: 10 Expensive Queries For the Last Week Reply with quote

Hi

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?
Back to top
View user's profile Send private message
Chris Spencer



Joined: 29 Aug 2006
Posts: 301
Location: Red Gate - Cambridge

PostPosted: Thu Jan 26, 2012 3:00 pm    Post subject: Reply with quote

Hi

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

[data].[Cluster_SqlServer_TopQueries_UnstableSamples_View]
[data].[Cluster_SqlServer_TopQueries_Instances_View]
[data].[Cluster_SqlServer_TopQueries_StableSamples_View]

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

Code:
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.

Regards
Chris
_________________
Chris Spencer
Test Engineer
Red Gate
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group