explain_query
Retrieve the execution plan for a SQL query, with optional hypothetical index simulation to test performance improvements.
Instructions
Get the query execution plan. Supports hypothetical index simulation (requires hypopg extension).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL query to explain | |
| analyze | No | Run EXPLAIN ANALYZE (executes the query — use with care on write queries in unrestricted mode) | |
| database | No | Database alias to query. Omit to use the primary database. | |
| hypothetical_indexes | No | Hypothetical indexes to simulate (requires hypopg extension) |