Suppose I run a very expensive query at 12:00pm. If at 12:01, I open SQL Server Activity Monitor and look at the recent expensive queries, I assume I'll see it there. What about 12:10? 12:30? 5pm? When will that query disappear from the view?
Likewise with execution per minute column, What period of time is averaged to find that value, and how often is it updated?
I know if you right click in the overview tab you can set your "Refresh interval" but that's not necessarily the same as the period over which data is analysed. Processes and resources waits are just a snap shot in time. But "recent expensive queries" is aggregated data from the last x minutes.
My question is how can I find what x is set to?
The Active Expensive and Recent Expensive queries will give you information about the queries which have high CPU, Logical Reads or High Elapsed time. You can go to each section for Current or Recent expensive queries. Sort them by Elapsed time, Logical Read and CPU Time one by one and check the execution plan.
Below is the way to identify the most costly SQL Server queries using DMV. If you are running this query from SSMS, you can click on the query_plan to view the graphical representation of the execution plan.
Go to Menu >> Query >> Select Include client Statistics. Execute your query. In the results panel, you can see a new tab Client Statistics. Go to the Client Statistics tab to see the execution time.
Activity Monitor is a tabbed document window with the following expandable and collapsible panes: Overview, Processes, Resource Waits, Data File I/O, Recent Expensive Queries, and Active Expensive Queries. When any pane is expanded, Activity Monitor queries the instance for information.
According to the documentation it is over the last 30 seconds only:
https://technet.microsoft.com/en-us/library/cc879320(v=sql.105).aspx
This pane shows information about the most expensive queries that have been run on the instance over the last 30 seconds. The information is derived from the union of sys.dm_exec_requests and sys.dm_exec_query_stats, and includes queries in process and queries that finished during the time period.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With