explain_query
Returns the PostgreSQL execution plan for any SQL statement. Optionally execute the query with real timing (automatically rolled back) to assess actual runtime cost.
Instructions
Return the PostgreSQL execution plan (EXPLAIN, FORMAT JSON) for a single statement. Cheap without analyze. With analyze=true the statement is actually executed to collect real timing — the transaction is always rolled back, so even in read-write mode nothing persists, but the statement's runtime cost is fully paid. Parameters are not supported here; inline literal values instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| analyze | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||