# Explain Query

> Run structured explain/explain-analyze workflows and convert plan output into explainable optimization insights.

- Skill: `rweisssieker-xp/explain-query` (Agent Skill)
- Install (CLI): `npx skillmds@latest add rweisssieker-xp/explain-query`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rweisssieker-xp/explain-query/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: rweisssieker-xp (https://skillmd.com/u/rweisssieker-xp)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/rweisssieker-xp/explain-query

---


# Explain Query

## Use when
- User asks why query is slow.
- Planner needs operator-level bottleneck explanation.

## Workflow
1. Parse query intent and classify risk (read-only preferred mode).
2. Collect `EXPLAIN` and `EXPLAIN ANALYZE` output in deterministic form.
3. Annotate scan patterns, joins, sort/hash/temp spills, and lock indicators.
4. Produce rewrite hypotheses with confidence scores.

## Governance
- Default to dry-run style if query could mutate data.
- Provide "why" and "impact estimate" before any recommendation.

## Output
- `plan`, `bottlenecks`, `rewriteHints`, `estimatedCost`, `confidence`

