tune_query
Opens a performance tuning session for an Azure SQL query, capturing actual execution plans and Query Store history for evidence-based analysis.
Instructions
Compatibility initializer only: open a performance case/session and collect evidence. It does not generate or benchmark a rewrite and must not be treated as a completed optimization. Named optimizer profiles use the explicit case/session workflow instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Read-only SQL query to tune. | |
| analyze | No | When true, execute the query to capture an actual plan. | |
| database_name | No | Optional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE. | |
| window_minutes | No | Query Store lookback window for history evidence. | |
| include_raw_xml | No | Include raw SHOWPLAN XML inline. Defaults to token-safe artifact URI only. | |
| parameter_types | No | Optional exact SQL types for the supplied parameter values. | |
| auto_bind_params | No | Bind @param placeholders from column statistics where possible. | |
| parameter_values | No | Explicit parameter values for representative execution; prefer this over heuristic statistics/type fallback binding. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||