This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Query Stats

General Workload analysis

The Query Stats dashboard summarizes workload characteristics and surfaces high cost queries so you can prioritize tuning and capacity decisions.

At the top:

  • Worker Time by Database: a chart that shows query worker time (CPU) attributed to each database. Use this to spot databases driving CPU usage and to compare trends over time.
  • Logical Reads by Database: a chart that shows logical page reads per database. High or rising reads indicate I/O pressure or inefficient query plans.

Below the charts are three sections that drill into queries and their history.

Query Stats by Database and Query

  • Shows top queries grouped by database and text (or normalized text).
  • Columns include cumulative worker time, logical reads, duration, and execution count. Use this view to find the heaviest queries within a specific database.
  • Use filters and sorting to narrow by database, application, or host, then click a row to open the query detail dashboard.

Query Stats by Query

  • Aggregates statistics across databases for identical or normalized query text. This helps identify widely-used queries or shared code paths that impact multiple databases.
  • Columns include totals and averages (CPU, reads, duration, executions) and can be used to detect candidates for indexing, parameterization, or query rewrite.

Query Regressions

  • Highlights queries with significant changes in performance over the selected time window (for example, increases in duration, CPU, or logical reads).
  • Uses baseline comparisons and historical plan information to flag likely regressions caused by plan changes, data distribution shifts, or blocking.
  • Click a query hash to inspect historical plans, execution stats, and complete query text.

Query Store and data sources

  • Query statistics are gathered from QMonitor event capture and, when enabled, from SQL Server Query Store. Query Store provides persisted plan history and runtime aggregates that are useful for regression analysis and plan forcing.
  • If Query Store is disabled or unavailable, QMonitor will use Query Stats.

Investigating queries

  • Drill into a query to view SQL text, execution plans, and example runtime statistics. Compare current and historical plans to identify plan changes.
  • Check execution counts — high cumulative cost with many executions may be fixed via caching or tuning; high single-execution cost may need plan-level fixes.
  • Use execution plans, wait types, and logical reads to decide between indexing, query rewrite, statistics updates, or parameter sniffing mitigations.

Controls and tips

  • Use the time-range selectors and per-column filters to focus analysis on the relevant interval and workloads.
  • Sort by cumulative worker time or logical reads to prioritize the biggest opportunities.
  • When investigating regressions, capture a longer history where possible to distinguish transient spikes from sustained regressions.

1 - Query Stats Detail

Detailed statistics about a specific SQL server query

The Query Stats Detail dashboard focuses on a single query (text or normalized text) and shows how each compiled plan for that query performed over the selected interval.

Top: Query text

  • The full SQL text (or normalized text) is shown at the top for context.
  • Use the copy and download controls to move the text into SSMS or a local editor.
  • Use the format button to view a formatted version of the query text

Plans summary table (Totals by plan)

  • A compact table that lists each plan compiled for this query with totals and averages:
    • Execution count
    • Worker time (total)
    • Total time (total)
    • Averages (worker time / exec, total time / exec)
    • Rows returned
    • Memory grant (total)
  • Use the table to quickly identify the highest-cost plans and their relative impact.

Totals section

  • This section contains a time-series table of 5-minute aggregated samples for the selected time frame. Each row represents a 5-minute bucket and includes:
    • Sample time
    • Execution count
    • Logical reads
    • Logical writes
    • Memory
    • Physical reads
    • Rows
    • Total time
    • Worker time
    • Plan hash (clickable)
  • Plan hash actions:
    • Click a plan hash to download the plan as a .sqlplan file.
    • Open the downloaded .sqlplan in SSMS to inspect the graphical plan and operator costs.
  • Charts in Totals:
    • Execution count by plan
    • Memory by plan
    • Total time by plan
    • Worker time by plan
  • Use these charts to compare plan behavior over time and to spot periods where a specific plan dominated resource usage.

Averages section

  • Similar to Totals, but values are averaged per sample or per execution:
    • The table shows the same 5-minute samples with averaged metrics (per-exec averages where applicable).
    • Columns mirror the Totals table (execution count, reads, writes, memory, physical reads, rows, total time, worker time, plan hash).
  • Charts in Averages:
    • Total time (avg) by plan
    • Worker time (avg) by plan
  • Use averages to find plans with high per-execution cost even if execution counts are low.

Controls and investigation tips

  • Use the dashboard time-range controls to focus on the interval of interest.
  • Filter or sort the tables by plan hash, execution count, or cost metrics to prioritize investigation.
  • Download and open .sqlplan files in SSMS to review operator costs, warnings, and estimated vs actual row counts.
  • Compare Totals and Averages: high totals with low averages usually indicate frequent cheap executions; high averages suggest expensive single executions.