explain_query
Show a SQL query's execution plan with cost estimates to diagnose performance, optionally running SELECTs for real statistics or simulating hypothetical indexes.
Instructions
Show the execution plan of a SQL query with cost estimates. A query with $1-style placeholders (as in query statistics) is explained with a generic plan. Hypothetical indexes need the hypopg extension.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL query to explain | |
| analyze | No | Run the query to show real execution statistics; only for a SELECT that passes the read check, inside the time limit | |
| hypothetical_indexes | No | Hypothetical indexes to simulate with hypopg; they are removed before the call ends |