explain_query
Generate estimated or actual execution plans for read-only SQL queries to diagnose performance issues and optimize query execution.
Instructions
Generate an estimated or actual execution plan for a read-only SQL query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Read-only SQL query to explain. | |
| analyze | No | When true, executes the query and returns an actual plan. | |
| database_name | No | Optional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE. | |
| include_raw_xml | No | When true, includes raw SHOWPLAN XML inline. Defaults to False; use raw_xml_resource_uri for token-safe retrieval. | |
| parameter_types | No | Optional declared SQL types keyed by parameter name, for example {'CustomerId': 'bigint'}. Supply exact types for faithful compilation. | |
| auto_bind_params | No | When true, automatically detects @param placeholders and binds them using column statistics or type-based fallback values. | |
| parameter_values | No | Optional JSON parameter values keyed by name (for example {'CustomerId': 42}). Values are passed as driver parameters and are not returned in the response. | |
| hypothetical_indexes | No | Reserved for future use. Hypothetical index analysis is disabled on this read-only tool for safety. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| headline | Yes |