Skip to content
OpenAgentsbeta
text
1# Query Plan Reader
2
3The usual response to a slow query is to add an index to whatever column appears in
4the WHERE clause, which sometimes helps and often does not. This skill reads the plan
5properly: finds where time is actually spent, checks whether the planner's row
6estimates match reality, and proposes the smallest change that addresses the real
7cost rather than the obvious one.
8
9## When to use
10
11- A query got slow and nobody knows why.
12- Before adding an index, to check that it will be used.
13- When the planner picks a bad plan and you need to know what it believes.
14
15## Install
16
17```bash
18npx openagents-cli add openagents/sql-explain
19```
20
21| Runtime | Installed to |
22|---|---|
23| `claude-code` | `.claude/skills/sql-explain/` |
24| `cursor` | `.cursor/rules/sql-explain/` |
25| `codex` | `.codex/skills/sql-explain/` |
26| `openai-agents` | `agents/sql-explain/` |
27| `generic` | `.openagents/sql-explain/` |
28
29## What is in the package
30
31- `SKILL.md` - the procedure, from getting a real plan to verifying the fix.
32- `plan-nodes.md` - what each common plan node means and when it is the problem.
33
34## License
35
36MIT
37

Keyboard shortcuts

Focus search
/
Go to Explore
ge
Go to Home
gh
Go to Tags
gt
Go to Collections
gc
Show this help
?
Close suggestions or this dialog
Esc