Query Store regressions and plan changes
list_query_store_regressionsIdentifies queries that became slower or heavier by comparing recent Query Store metrics with prior days, showing plan changes and regressions. Use it first when a query or process slows down.
Instructions
Finds the queries that got slower or heavier, vary the most or changed plan, from the Query Store: it compares each query's recent window with the days before it, as SSMS's Regressed Queries and Queries With High Variation reports do, and returns per query the executions and the average and maximum of the metric in each window, their ratio, the plans used in each window, whether the dominant plan changed, the plans compiled in the recent window and the aborted or failed executions in it. The variants of a parameter-sensitive query (SQL Server 2022+) count under it. Use it first when a query or a process got slow; for one query's full history use get_query_store_history, and to find a query by its text or procedure use find_query_store_queries. Needs VIEW DATABASE STATE (2022+: VIEW DATABASE PERFORMANCE STATE), which VIEW SERVER STATE implies.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"database": "<database>"
},
"name": "list_query_store_regressions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Most queries to return (default 20, at most 100). | |
| metric | No | What to compare: 'duration' (default), 'cpu', 'logical_reads' or 'physical_reads'. Duration and CPU come in milliseconds, reads in 8 KB pages. | duration |
| database | Yes | Name of the database as registered in the configuration. | |
| order_by | No | 'regression' (default): the queries whose average for the metric rose against the history window, worst first by how much more of it their recent executions used in total (time for duration and CPU, pages for reads); 'variation': the least stable over both windows; 'plan_count': the queries that used more than one plan. | regression |
| history_days | No | Days before the recent window to compare it with (default 7). | |
| recent_hours | No | Hours in the recent window, which ends now (default 24). A Query Store interval that straddles its start counts as recent. | |
| min_executions | No | Fewest executions a query needs in the recent window, and for 'regression' in the history window too, to be listed (default 2). |