query-store-investigation
Installation
SKILL.md
Query Store Performance Investigation
Use this skill when the user asks about query performance analysis, top resource-consuming queries, or recently regressed queries and Query Store is enabled.
Scope
- Covers top resource-consuming queries (duration, CPU, logical IO), regressed queries found by comparing a recent runtime window with a historical baseline, and the best historical plan versus the current plan.
- For volatile or intermittent queries, one query_id's interval-by-interval drill-down, per-query waits, aborted executions, forced-plan failures, or parameter sensitivity, use
query-store-volatile-historical-slow-queries-comparison.
Required tools
- A SQL query tool connected to the target server and database. Prefer, in order: the SQL Tools MCP
server that ships with the
microsoft-sql-adminplugin (mssql_list_database_connections,mssql_connect_database, thenmssql_execute_query); any other SQL tool the agent host provides for running T-SQL and reading result sets;sqlcmdfrom a terminal. If the SQL Tools MCP server is not connected or lists no connections, follow thesql-tools-mcp-setupskill, which asks before installing or configuring anything. If no SQL tool can be made available, give the user the T-SQL to run and ask for the results.