Explain a query plan
explain_queryDisplays a SQL query's execution plan so you can diagnose performance. Set analyze to run it read-only and rolled back, returning actual timings and PostgreSQL buffers.
Instructions
Shows the execution plan of a query. analyze=true really runs it (still read-only and rolled back) and reports actual times (and buffers on PostgreSQL).
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": {
"connection": "<connection>",
"sql": "<sql>"
},
"name": "explain_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The query to explain (without EXPLAIN). | |
| params | No | ||
| analyze | No | Execute the query to get real timings. Default false. | |
| connection | Yes | DBeaver connection name (as shown in DBeaver), its id, or project/name. See list_connections. |