mssql-performance-revi…
Agentic offline orchestrator for end-to-end SQL Server performance reviews. Forms hypotheses from artifacts or symptoms, dispatches the specialised review…
Analyze SQL Server procedure/trigger/function runtime stats collected from sys.dm_exec_procedure_stats into collect.proc_stats. Applies 25 checks (R1–R25) across five categories — top consumers, per-execution efficiency, pattern detection, trend analysis, and advanced runtime
$ npx -y skills add vanterx/mssql-performance-skills --skill sqlprocstats-review --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sqlprocstats-reviewContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyze SQL Server procedure/trigger/function runtime stats collected from sys.dm_exec_procedure_stats into collect.proc_stats. Applies 25 checks (R1–R25) across five categories — top consumers, per-execution efficiency, pattern detection, trend analysis, and advanced runtime
name: sqlprocstats-review description: Analyze SQL Server procedure/trigger/function runtime stats collected from sys.dm_exec_procedure_stats into collect.proc_stats. Applies 25 checks (R1–R25) across five categories — top consumers, per-execution efficiency, pattern detection, trend analysis, and advanced runtime patterns. Use when pasting output from the report queries in scripts/collection/04_report_queries.sql. triggers: - /sqlprocstats-review - /proc-stats
Analyze runtime statistics collected from `sys.dm_exec_procedure_stats`, `sys.dm_exec_trigger_stats`, and `sys.dm_exec_function_stats` into the `collect.proc_stats` table. Applies 25 checks (R1–R25) across five categories:
burning the most CPU, reads, or elapsed time in the collection interval
of how often they run — high average CPU, high reads, parameter sniffing signals, spills
workload concentration, infrequent-but-heavy outliers
plan changes, new high-cost entries (requires ≥ 3 snapshots from Q5)
trigger-dominated elapsed time, parallel-to-serial regression, Query Store plan instability
Accept any of:
`scripts/collection/12_report_all_collections.sql` Section 2; all R-checks apply equally to statement-level data — just note the object_name may be NULL for ad-hoc SQL
For trend checks (R16–R20), Q5 output with ≥ 3 rows per object is required. State "Cannot evaluate R16–R20 — trend data not provided" if Q5 is absent.
| Column | Source | Notes | |--------|--------|-------| | `execs_in_interval` | `execution_count_delta` | Executions since last snapshot | | `cpu_ms_per_sec` | `worker_time_per_sec` | CPU ms consumed per second of sample | | `avg_cpu_ms` | `avg_worker_time_ms` | Avg CPU per execution (ms) | | `avg_elapsed_ms` | `avg_elapsed_time_ms` | Avg wall-clock per execution (ms) | | `max_cpu_ms` | `max_worker_time / 1000` | Single worst execution CPU (ms) | | `avg_logical_reads` | computed | Avg 8-KB page reads per execution | | `reads_per_sec` | computed | Logical reads per second | | `avg_spills` | computed | Avg TempDb spill pages per execution | | `physical_reads_delta` | delta | Total physical reads in interval | | `physical_pct` | computed | Physical reads as % of logical (cache miss rate) | | `execs_per_sec` | computed | Execution rate per second | | `max_to_avg_cpu_ratio` | computed | max_cpu_ms / avg_cpu_ms — parameter sniffing signal | | `cpu_to_elapsed_ratio` | computed | avg_cpu / avg_elapsed — > 1.5 = parallel; < 0.2 = blocking/IO | | `sample_seconds` | delta SP | Duration of the collection interval | | `cache_age_minutes` | computed | How long the current plan has been in cache |
---
| Metric | Info | Warning | Critical | |--------|------|---------|----------| | `cpu_ms_per_sec` (single proc) | — | ≥ 50 ms/s | ≥ 500 ms/s | | Single proc share of total CPU delta | — | > 50% | > 80% | | `avg_cpu_ms` per execution | — | ≥ 1,000 ms | ≥ 10,000 ms | | `avg_logical_reads` per execution | — | ≥ 50,000 | ≥ 500,000 | | Physical reads as % of logical | — | > 10% | > 50% | | `execs_in_interval` | — | ≥ 10,000 | — | | `execs_per_sec` (chatty) | — | ≥ 10/s | ≥ 100/s | | `avg_spills` per execution | — | ≥ 1 | ≥ 10 | | `cpu_to_elapsed_ratio` (parallel waste) | — | > 1.5 | > 3.0 | | `cpu_to_elapsed_ratio` (blocking/IO wait) | — | < 0.2 | < 0.05 | | `max_to_avg_cpu_ratio` (sniffing signal) | ≥ 3 | ≥ 10 | ≥ 100 | | Top 3 procs share of total CPU delta | ≥ 70% | ≥ 90% | — | | `avg_elapsed_ms` per execution | — | ≥ 5,000 ms | ≥ 30,000 ms | | Trend: execution rate spike | — | latest > 2× mean | > 5× mean | | Trend: CPU worsening (monotonic) | 2 snapshots | 3+ snapshots | — |
---
Run these first. They identify which objects dominate the workload in the collection interval.
SQL Server performance tuning skills for LLMs — 829 checks across 26 skills covering T-SQL, execution plans, wait stats, deadlocks, Query Store, indexes, encryption, Always On AG, WSFC, ERRORLOG, SPN, memory, disk I/O, config drift, setup logs, SSRS & migration readiness. Remote MCP server on Cloudflare Workers.
Repo: vanterx/mssql-performance-skills
Agentic offline orchestrator for end-to-end SQL Server performance reviews. Forms hypotheses from artifacts or symptoms, dispatches the specialised review…
Audits SQL Server Always On Availability Group configuration correctness across all layers — prerequisites, replica design, listener architecture, backup…
Analyze SQL Server lock blocking from sys.dm_exec_requests, sys.dm_exec_sessions, sys.dm_os_waiting_tasks, sys.dm_tran_locks, open-transaction DMVs, blocked…
Analyze SQL Server Setup Bootstrap log files to diagnose failed installations, failed Cumulative Update or Service Pack patching, failed cluster node…
Analyzes Windows Server Failover Cluster (WSFC) CLUSTER.LOG files for Always On Availability Group root-cause diagnosis. Use this skill when an availability…
Analyze SQL Server instance and database configuration drift against proven DBA best practices. Applies 29 checks (B1–B29) across five categories: parallelism…