pg_explain_hypothetical_index
Simulate hypothetical indexes to analyze their impact on a query's execution plan using hypopg.
Instructions
Explain a query's execution plan simulating hypothetical indexes using the hypopg extension (if installed).
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>",
"indexes": "<indexes>"
},
"name": "pg_explain_hypothetical_index"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SELECT query to explain (do NOT use EXPLAIN ANALYZE). | |
| indexes | Yes | Array of index definitions (e.g. ['CREATE INDEX ON users (email)']). | |
| connectionId | No | Id of the postgres connection to use, from databases.config.yml. Optional when only one postgres connection is configured. |