Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Over what period of time does SQL server activity monitor look at to recent expensive queries

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?

like image 272
TizzyFoe Avatar asked Mar 23 '16 09:03

TizzyFoe


People also ask

What is recent expensive queries in SQL Server?

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.

How do I find the most expensive query in SQL Server?

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.

How do I find the query execution time in SQL Server?

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.

What is SQL Server Activity Monitor?

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.


1 Answers

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.

like image 50
Necreaux Avatar answered Sep 29 '22 23:09

Necreaux