investigate-sql-cpu-pressure
Installation
SKILL.md
CPU Pressure Investigation
Purpose
This is the primary entry point for investigating CPU pressure and high CPU consumption in SQL Server and Azure SQL. Use when a user reports:
- High CPU usage or CPU % alerts
- Queries running slowly due to scheduler pressure
SOS_SCHEDULER_YIELD,THREADPOOL, orCXPACKETwaits- Azure SQL DTU/vCore CPU throttling
This skill orchestrates a layered investigation:
- Checking edition-appropriate CPU signals (resource stats on Azure SQL; scheduler snapshot on SQL Server)
- Identifying real-time CPU consumers and their wait types
- Shortlisting active offender hashes for targeted SQL text and plan analysis
- Reviewing historical plan-cache or database-scoped Query Store data for CPU consumers
- Detecting memory-grant waits and reduced grants that may contribute to spills
- Identifying plan quality smells (implicit conversions, spills, missing-index hints, key lookups, and scalar UDFs) by inspecting live plan XML
- Conditional: when the evidence points to specific workload queries, retrieving and analyzing the full SQL text and cached plan for the top offending
query_hashvalues to produce concrete tuning recommendations