Db explain
Run EXPLAIN [ANALYZE] on a query and return the parsed plan with flags for sequential scans and probable missing indexes — performance evidence, not a guess. Read-only. Use when a query is slow or before shipping a query-heavy path.From its SKILL.md
npx -y skills add nuttaruj/rolepod-dblab --skill db-explainAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.6 KB, as published. Nobody here has run it
/db-explain
Single-backend skill. Calls rolepod_db_explain on the rolepod-dblab MCP server and surfaces the structured result. No fallback (D-001).
Is this query going to scan a whole table? Where is an index missing?
Phase: Perf / Review. Read-only — EXPLAIN runs inside a READ ONLY transaction, so even ANALYZE (which executes the query) cannot mutate.
When to use
- A query is slow and you want the real plan, not a hypothesis.
- Reviewing a query-heavy change before merge.
- Confirming an index you added is actually used.
When NOT to use
- Target is a WordPress site →
rolepod-wplabfor WP query concerns. - You want to assert data state →
/db-query. You want to mutate →/db-write. - You want to add the index → that's a migration/write; dblab flags the need, it does not redesign the schema (SPEC §3).
Inputs
conn— connection string (secret; never logged).sql— the query to analyze.analyze(optional, default false) — useEXPLAIN ANALYZE(executes the query to get real timings; still read-only).
Process
Call rolepod_db_explain:
{ "conn": "postgresql://…/db", "sql": "SELECT * FROM events WHERE kind = 'a'", "analyze": false }
Outputs
has_concerns— true if any probable-missing-index flag fired.flags[]— each:kind(seq_scan|possible_missing_index),relation,plan_rows,filter?,detail.plan— the raw parsed JSON plan;manifest_path(phasereview, statuswarnwhen concerns, elsepass).
Examples
Find the missing index behind a slow filter
{ "conn": "postgresql://…/db", "sql": "SELECT * FROM events WHERE kind = 'signup'" }
A possible_missing_index flag on events with the filter on kind → consider CREATE INDEX … ON events(kind).
Evidence routing
- Standalone:
.rolepod-dblab/artifacts/db-explain_<ts>_<uuid>/ - With
rolepodparent (marker<git-root>/.rolepod/parent-active):<git-root>/.rolepod/evidence/<ts>-rolepod-dblab-db-explain/
The run directory holds plan.json + a manifest.json (Extension Protocol v1), so review-code can read the plan as performance evidence.
If the tool is unavailable
The
/db-explainskill needs the rolepod-dblab MCP server, which is not currently available. Confirm the plugin is installed and try again, or check thatnpx -y @rolepod/dblabis reachable.