query_plan
Retrieve the execution plan for a SQL query without executing it. Supports PostgreSQL, MySQL, and Redshift, returning JSON or text plans for query optimization.
Instructions
Get the execution plan (EXPLAIN) for a SQL query without running it. postgres/mysql return a JSON plan; redshift returns a text plan (Redshift supports neither FORMAT JSON nor EXPLAIN ANALYZE, and its cost numbers are relative — do not compare them to postgres costs).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | SQL text to explain (the query itself is not executed) | |
| database | No | Database to explain against; required when the connection declares multiple databases | |
| connection | Yes | Connection key from connection_list |