Databases · inspect by default
/db-explain
Interpret query plans and identify expensive operations
Use to interpret an existing query plan or one captured in a permitted environment; db-index proposes an index from workload evidence.
Make it your own.
In Claude Code, use the slash command and add your context. In Codex, select db-explain from the just-vibe skill picker, then send the same brief.
Version 0.11.0 also supports /jv db-explain, /just-vibe db-explain and /jv:db-explain in Claude. See shortcut setup and context examples.
/just-vibe:db-explain Interpret this saved query plan without executing EXPLAIN ANALYZE./just-vibe:db-explain Explain a plan whose nested loop multiplies work through a row-estimate error./just-vibe:db-explain Analyze EXPLAIN output without executing EXPLAIN ANALYZE or mutating functions.What the agent does
- Read estimated versus actual rows, loop counts, filters, joins, sorting/spilling and buffers using engine-specific meaning.
- Locate the first large estimation divergence and the costly stages, and propose discriminating measurements.
Inputs
- query, engine/version, saved execution plan, and workload context.
Optional context: scope, references, constraints, successCriteria, environment, mode, budget.
Scope
- Reads
- Plan interpretation, estimates, scans, joins, sorting, and evidence-supported bottlenecks.
- Writes
- No source changes in inspect/plan. Save only requested planning artifacts. db-query or db-index applies an accepted query or index change.
- Mode
- Inspect; query, engine/version, saved execution plan, and workload context.
- Prerequisites
- Actual engine/version, schema/migrations, query workload, and explicitly identified environment. Prefer supplied plans, metadata, and isolated fixtures. Even a SELECT can lock, call mutating functions, or overload a database; inspect semantics before execution. Executing an analyzed query is distinct from reading its plan.
Expected output
- Annotated plan with operator evidence, the likely bottleneck, targeted query/index/statistics options, and a discriminating measurement with the risk of running it.
How the work is checked
- Estimated costs are not mislabeled as milliseconds; a row-estimate error is distinguished from a missing index.
When to stop or clarify
- EXPLAIN ANALYZE or equivalents execute work and require appropriate authorization. No mutation hidden inside profiling.
Handling missing context
- Infer
- Read engine/version, ORM/runner, schema and migration history from project artifacts before choosing SQL.
- Assume
- Prepare local SQL and isolated fixtures without assuming production size, locks or recovery guarantees.
- Ask
- Ask for environment, downtime or recovery constraints before live/destructive execution when missing; unavailable production access does not block migration files.
Technical guidance
- Evidence
- Read engine/version, query bindings, plan format, row estimates, actual counts/loops and available timing.
- Method
- Locate the first major estimation or repeated-work divergence and relate it to predicates, statistics and access paths.
- Pitfall
- Abstract cost is not milliseconds; EXPLAIN ANALYZE executes the statement and may mutate data or consume production resources.
- Check
- Compare plans under equivalent parameters/data and verify unchanged results; without execution permission, report hypotheses from saved plans only.
Situational decisions
When only an estimated plan is supplied: Discuss cost/shape hypotheses without converting cost units into milliseconds or inventing execution statistics.
The coding agent follows this workflow using its available tools. Installation does not grant service access or guarantee an outcome. Read the compatibility notes.