explain_query
Understand why a Postgres query is slow by reading its plan in plain language. Get estimates without executing, and identify costly steps.
Instructions
EXPLAIN a query (by literal SQL or by pg_stat_statements queryid) and read the plan in plain language.
Estimates only: without analyze this never executes the query, and the reading says what is expensive and why — it is NOT a recommendation. 'analyze' actually runs the query (SELECT-only, gated per profile by allow_analyze; refused on profiles that do not opt in). For parameterized queries pass 'params' with representative values — skewed values often change the plan entirely.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | No | ||
| params | No | ||
| analyze | No | ||
| profile | Yes | ||
| queryid | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||