| Author |
Message |
UnicornsRreal
Joined: 27 May 2011 Posts: 5
|
Posted: Thu Jan 26, 2012 12:53 pm Post subject: 10 Expensive Queries For the Last Week |
|
|
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 |
|
 |
Chris Spencer
Joined: 29 Aug 2006 Posts: 300 Location: Red Gate - Cambridge
|
Posted: Thu Jan 26, 2012 3:00 pm Post subject: |
|
|
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 |
|
 |
|
|
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