compare_query_plans
Compare two query plans to reveal differences in operators, duration, CPU, and I/O. When plan IDs are omitted, automatically contrasts the best and worst performing plans.
Instructions
Compare two query plans side-by-side: operators, duration, CPU, I/O. If plan IDs not specified, compares best vs worst plan by duration.
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": {
"query_id": "<query_id>"
},
"name": "compare_query_plans"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query_id | Yes | Query Store query_id. | |
| plan_id_a | No | First plan_id to compare (optional, uses best by default). | |
| plan_id_b | No | Second plan_id to compare (optional, uses worst by default). | |
| database_name | No | Optional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||