execution-plan-analysis
Installation
SKILL.md
Execution Plan Analysis
Use this skill to triage SQL Server actual or estimated execution plans, especially .sqlplan ShowPlan XML. Treat the plan as evidence, not a verdict: validate schema, data types, indexes, row counts, partitioning, parameter values, and local-vs-linked-server execution before recommending rewrites or indexes.
Required Inputs
Ask for the smallest set needed to verify the plan:
- SQL Server version, database compatibility level, and Azure SQL vs boxed SQL Server.
- Actual plan when available; estimated plan if execution is unsafe.
- Query text, parameter values, SET options if relevant, and runtime symptoms.
- Table DDL, column data types, indexes, statistics age, partition scheme/function, and row counts.
- Whether referenced objects are local, remote linked servers, views, table-valued functions, or temp tables.
- Allowed changes: query rewrite, statistics update, index add/drop/change, computed column, staging table, or no code change.
Use ../_shared/optimization-intake.md and ../_shared/assumption-tracker.md for intake and assumption status tracking.