explain_query
Inspect PostgreSQL query execution plans to identify performance issues. Run EXPLAIN or EXPLAIN ANALYZE on any SELECT statement to see how the database executes it, helping you optimize slow queries before deployment.
Instructions
Run EXPLAIN (or EXPLAIN ANALYZE) on a query and return the plan.
Args: sql: The SELECT query to explain. analyze: If True, actually executes the query to get runtime stats (EXPLAIN ANALYZE). Default: False (plan only, no execution).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| analyze | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |