Status: Reviewed (deep-dive v1)
Stack: PowerShell (schedule off-peak collectors) → SQL DMV snapshots/procs → Blazor Server UI
Depends on: SQL-01 Inventory; use with SQL-03 (stats/indexes), SQL-04 (jobs), SQL-06 (disk pressure)
Goal: Ops-level visibility into waits, blocking, and expensive queries — not a full tuning engagement every time.
Capacity and jobs tell you the plumbing. Performance health tells you whether the instance is hurting right now and what to look at first.
Keep this ops triage, not deep plan analysis essays.
| Signal | Why it matters | First check |
|---|---|---|
| Blocking chain | Users stuck | Head blocker SPID/query |
| High wait (PAGEIOLATCH, WRITELOG, LCK_*, CXPACKET/CXCONSUMER, SOS_SCHEDULER_YIELD) | Points at IO / log / locking / CPU / parallelism | Correlate with disk (SQL-06) and jobs (SQL-04) |
| Top CPU / duration / reads | Who’s burning the box | Same query hash repeating? |
| Thread/worker pressure | Scheduler starvation | Concurrent jobs + parallelism |
| Plan cache bloat / single-use plans (optional later) | Memory waste | Ad-hoc workload |
Run light, on a schedule (e.g. every 1–5 min for “now”; hourly rollups). Prefer DMVs; avoid traces unless XE already exists.
sys.dm_os_wait_stats delta since last sample (reset-aware)sys.dm_exec_requests + sys.dm_exec_sessions (+ optional dm_os_waiting_tasks)sys.dm_exec_query_stats cross apply plan/text — by CPU, duration, logical reads (top N)sys.dm_os_performance_counters (Batch Requests, Page life expectancy — interpret carefully)CollectedAt; store deltas for waits, not only cumulativePS role: schedule Invoke-Sqlcmd / collector; optionally skip collect if host CPU already pegged by maintenance window flag.
Do not collect full plans for every query in v1 — text + query_hash + stats is enough for the board.
| Table | Purpose |
|---|---|
dbo.PerfWaitSample |
Wait deltas by wait_type |
dbo.PerfBlockingEvent |
Observed blocker/victim pairs (sampled) |
dbo.PerfTopQuery |
Top N rows per sample (hash, stats, truncated text) |
dbo.PerfSampleRun |
Run audit |
Procs:
usp_Perf_ApplyWaitDeltausp_Perf_ApplyBlockingSampleusp_Perf_ApplyTopQueriesusp_Perf_GetHotWaits — Blazorusp_Perf_GetBlockingNow — current/recent chainsusp_Perf_GetTopQueries — filter by metricRetention: detail 7–14 days; rollups optional later.
| Symptom | Likely cause |
|---|---|
| Everything slow, PAGEIOLATCH | Storage / memory pressure / cold cache after restart |
| Periodic stalls | Agent job window; autogrowth; backup IO |
| One app stuck, others fine | Blocking or app-side connection pileup |
| CXPACKET high | Often symptom; check skew + Cost Threshold / MAXDOP policy with Rick |
| Board empty | Collector rights; Agent stopped; wrong instance |
VIEW SERVER STATE typical for DMVs Patching & build currency · HA/DR awareness · Alerting & runbooks
SQL Dude — SQL-07 Performance Health v1