get_regressed_queries
Detect SQL queries whose performance regressed by comparing recent Query Store metrics to an earlier baseline and flagging threshold breaches.
Instructions
Detect queries whose performance regressed by comparing a recent period against an earlier baseline period from Query Store.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | Max rows to return. | |
| metric | No | Metric to evaluate regression against. | cpu_time |
| recent_hours | No | Length of the recent window, in hours. | |
| database_name | Yes | Target SQL Server database name. | |
| baseline_hours | No | Length of the baseline window preceding the recent window, in hours (default 7 days). | |
| min_executions | No | Ignore queries with fewer executions than this in either period (filters noise). | |
| regression_threshold | No | Minimum fractional worsening to flag (0.5 = 50% worse than baseline). |