Docs/Modules/Wait Statistics

Wait Statistics

Analyze SQL Server wait categories, blocking chains, trend windows, query-plan correlation, and exportable AI-backed wait diagnostics from one workflow.

Overview

Wait Statistics is the wait-centric diagnostics module. It combines cumulative SQL Server wait data, active waiting sessions, blocking-chain analysis, historical trend snapshots, optional query-context correlation, and current-session threshold signals so you can identify the dominant source of performance pressure quickly.

This module is most valuable alongside Query Statistics when you need wait-to-plan correlation, and Blocking Analysis when waits point to live blockers and chain depth.

What You Can Do
  • Inspect dominant wait types and wait-category pressure.
  • Review active waiting sessions and blocking chains.
  • Compare against a saved baseline or explicit before/after snapshots.
  • Configure current-session threshold signals, refresh-driven snapshots, and custom regex categories.
  • Export the current analysis to HTML, JSON, or Markdown.
Main Screen Areas
  1. Header card
  2. Filter bar
  3. Main content tabs
  4. Right-side insight panel
Screen 1

Main Wait Diagnostics Layout

The opening view combines the filter bar, top waits presentation, summary metrics, and the first layer of wait interpretation. This is the primary screen for deciding whether the dominant pressure is CPU, I/O, lock, memory, or network related.

Screen 2

Trend View for Historical Wait Direction

Trend view helps determine whether the dominant wait pattern is new, recurring, or gradually increasing. The module prefers Query Store wait history when available and falls back to local snapshots when Query Store wait history is missing.

Screen 3

Blocking Chain Evidence

When lock-related waits or live request contention matters, the blocking tree helps explain whether root blockers and blocked sessions are responsible for the current wait profile. This complements cumulative wait counters with live runtime evidence.

Automation Screen Note

Current-Session Refresh and Admin Controls

The current public asset set does not include a clean standalone screenshot for the Automation tab, so this page describes those controls in text instead of showing a mismatched image. The available controls still include refresh-driven snapshots, a 5-second visible-view refresh option, custom wait categories, outbound targets, and the guarded admin-only wait reset flow. These controls do not run as a background service when the application or view is closed.

Screen 4

Wait Insights and Actionable Guidance

The right-side insight stack turns the current evidence into an operational narrative: threshold signals, dominant signatures, baseline deltas, wait-to-plan notes, outbound target status, and a short recommended action list.

Data Sources and Analysis Model
Core Wait Data
  • Uses SQL Server DMVs such as sys.dm_os_wait_stats, sys.dm_exec_requests, and sys.dm_exec_sessions.
  • Builds top-wait, wait-summary, wait-category, and current-wait views from refresh results.
  • Separates total wait, signal wait, resource wait, and active waiting-session evidence.
Historical Trend Source
  • Prefers Query Store wait history through sys.query_store_wait_stats.
  • Falls back to locally persisted snapshots when Query Store wait history is unavailable.
  • Trend source can therefore resolve to query_store, local_history, or none.
Blocking and Live Chains
  • Uses shared blocking services to explain active contention chains.
  • Shows root blockers and blocked sessions with database, login, wait, and wait-ms context.
  • Supports DB, App, and Min Wait filters when rendering live trees.
Query Context Mode
  • When opened with query context, waits can switch from server-level to query-correlated evidence.
  • The Wait / Plan panel becomes meaningful only in this mode.
  • This is why the module has distinct server-level and query-context behaviors.
Header, Filters, and Main Tabs
Header Card
  • Optional focus context label
  • Refresh
  • Set Baseline
  • Export
Filter Bar
  • Trend Window
  • DB Filter
  • App Filter
  • Min Wait
  • Apply Filter and progress label
Main Tabs
  1. Top Waits
  2. Trend & Blocking
  3. Automation
Top Waits Behavior
  • Rows show wait type, category, impact line, sparkline, wait time, tasks, percent, and max wait.
  • Display source can be cumulative waits, grouped current waits, or query-correlated waits.
  • Heuristic action hints help convert dominant waits into next-step investigation tasks.
Automation and Admin Controls
Scheduled Snapshot
  • Supports periodic snapshot and report generation.
  • Current UI exposes enabled state, interval, and Save Schedule.
  • Snapshot generation runs when refresh occurs and the configured interval is due.
5s Visible-View Refresh
  • Refreshes every 5 seconds only while this view remains open and visible.
  • It is not a background collector and stops when the view or desktop application is closed.
  • Exposes visible thresholds for total wait, lock wait, and blocked sessions.
  • The underlying service supports more alert fields than the main UI currently edits.
Custom Categories
  • Supports operator-defined regex-based wait groups.
  • Only enabled rules contribute to current custom-category totals.
  • Rules can be added or removed from both the Automation tab and the Actions panel.
Admin Clear Safety
  • Clear Wait Stats is the only destructive action in the module.
  • It requires an armed admin session, active connection, warning confirmation, and exact phrase entry.
  • The action runs server-wide counter reset behavior and is audit-logged.
Right-Side Insights
Summary and Categories
  • Summary shows Total Wait, Signal Wait, Resource Wait, and Current Waiters.
  • Health state is primarily driven by resource-wait percentage.
  • Wait Categories quickly summarize CPU, I/O, Lock, Latch, Memory, Network, Buffer, and Other pressure.
Insight Blocks
  • Alerts
  • Signature
  • Before / After
  • Actions
  • Wait / Plan
  • Outbound target status
  • Actionable Intelligence
Signature and Alerts
  • Alerts highlight threshold breaches, wait growth, and blocking risk signals.
  • Signature summarizes the dominant pattern with confidence and short evidence text.
  • Typical signature families include CPU pressure, I/O bottleneck, lock contention, and memory grant pressure.
Wait / Plan and Intelligence
  • Wait / Plan explains correlations such as lock waits with scans or I/O waits with spills and lookups.
  • Outbound target status summarizes configured destinations; delivery depends on the active desktop session.
  • Actionable Intelligence turns waits, alerts, signatures, baseline deltas, and trend direction into an operator playbook.
Sample AI Analysis Report

The current Wait Statistics asset set includes one exported HTML report. It can be opened directly in the browser or downloaded for offline review, handoff, or ticket attachment.

Detailed Control Reference
Buttons
  • Refresh
  • Set Baseline
  • Export
  • Apply Filter
  • Save Before
  • Save After
  • Compare
  • Custom Category
  • Remove Custom
  • Save Schedule
  • Save Thresholds
  • Add Category
  • Remove Category
  • Clear Wait Stats (Manual Admin)
  • Add Server Target
  • Remove Target
  • Push Metrics Now
Checkboxes
  • Scheduled Snapshot Enabled
  • Enable 5s Monitor (while view is visible)
  • Enable Admin Tools for this session
Comboboxes
  • Trend Window
  • DB Filter
  • App Filter
  • Display
Behavior Notes and Typical Workflow
Important Behavior Notes
  • DB, App, and Min Wait filters do not fully rewrite cumulative wait-summary totals.
  • Set Baseline is separate from explicit Save Before / Save After comparison.
  • Trend source can switch between Query Store, local history, and none.
  • Some alert and schedule fields exist in the service model but are not fully editable in the visible UI.
Typical Workflow
  1. Click Refresh and review Summary, Wait Categories, and Alerts.
  2. Inspect Top Waits to identify the dominant wait profile and suggested actions.
  3. Use Trend & Blocking to determine whether the issue is persistent or tied to live blockers.
  4. Capture a baseline or explicit before/after snapshots when measuring change impact.
  5. Use Automation for current-session thresholds, refresh-driven snapshots, and outbound targets.
  6. When opened from Query Statistics, use Wait / Plan to connect waits with a specific plan shape.
Related References

For deeper SQL Server investigation, pair this module with Query Statistics for query-level regression analysis, Blocking Analysis for chain-first lock investigation, and Dashboard for broader CPU, I/O, memory, and workload pressure context.