explain_query
Run EXPLAIN on a SQL query to inspect PostgreSQL planner cost estimates, join strategies, and index usage.
Instructions
Execute EXPLAIN on a SQL query to inspect query planner cost estimates, join strategies, and index usage.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sql": "<sql>"
},
"name": "explain_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL query to explain | |
| analyze | No | If true, runs EXPLAIN ANALYZE (actually executes the query to get actual timings). Default: false. |