pg_query_explain
View a SQL query execution plan without executing, or run EXPLAIN ANALYZE for actual timing with confirmation.
Instructions
Run EXPLAIN on a query. mode=plan (default, safe) shows the plan without executing. mode=analyze executes the statement and shows actual timing — requires confirm=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL query to explain | |
| mode | No | Explain mode: plan (safe) or analyze (executes, requires confirm) | plan |
| params | No | JSON array of parameter values | |
| target | Yes | Target name from ~/.dbx/targets/ | |
| confirm | No | Set to 'true' for mode=analyze (EXPLAIN ANALYZE executes the statement) |