analyze_explain_plan
Parse PostgreSQL or MySQL EXPLAIN/ANALYZE output to identify execution bottlenecks and generate a Mermaid plan flowchart for query tuning.
Instructions
Parse PostgreSQL or MySQL EXPLAIN / EXPLAIN (ANALYZE, BUFFERS) output (Text or JSON) to identify execution bottlenecks (Seq Scan, External Disk Sort, Heap Fetches, Row Misestimations) and generate a Mermaid plan flowchart.
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": {
"dialect": "<dialect>",
"explain_output": "<explain_output>"
},
"name": "analyze_explain_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dialect | Yes | ||
| sql_query | No | ||
| explain_output | Yes | ||
| existing_schema_ddl | No |