explain_query
Analyze SQL query performance by generating execution plans with cost estimates to optimize PostgreSQL database operations.
Instructions
Get the execution plan for a SQL query (EXPLAIN).
Args:
sql: SQL query to explain
analyze: If true, actually runs the query to get real execution stats
(EXPLAIN ANALYZE). Use with caution on slow queries.
Returns:
Execution plan in JSON format with cost estimatesInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| analyze | No |