ワンクリックで
sql-explainer
Explain SQL queries, execution plans, and performance issues in plain English with rewrites
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Explain SQL queries, execution plans, and performance issues in plain English with rewrites
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Generate system architecture diagrams as Mermaid, PlantUML, or ASCII art from a description or codebase
Convert images or video frames to ASCII art, or generate ASCII animations from descriptions
Generate concept maps, mind maps, and ER diagrams from free-form descriptions
Design, implement, and debug ETL/ELT pipelines — batch or streaming, any source/sink
Guide incident response: triage, diagnosis, mitigation, communication, and post-mortem
Triage application and system logs to find root causes, anomalies, and error patterns
| name | sql-explainer |
| description | Explain SQL queries, execution plans, and performance issues in plain English with rewrites |
| category | data |
Explain SQL queries, analyse execution plans, identify performance bottlenecks, and suggest rewrites.
For any query:
WHAT IT DOES (one sentence)
STEP BY STEP:
1. FROM / JOIN — which tables, join type and implications
2. WHERE — filters, sargability (can indexes be used?)
3. GROUP BY / HAVING — aggregation logic
4. SELECT — columns, computed expressions
5. ORDER BY / LIMIT — sort and pagination
EDGE CASES:
- NULLs: which columns and how they affect results
- Empty sets: what happens if a subquery returns no rows
- Duplicates: expected or a bug?
PERFORMANCE NOTES:
- Estimated scan type
- Columns that should have indexes
- Estimated row count at each stage
ANALYZE needed).work_mem.| Anti-pattern | Fix |
|---|---|
SELECT * in subquery | Select only the join key |
NOT IN (subquery with NULLs) | Use NOT EXISTS |
| Correlated subquery in SELECT | LEFT JOIN + COALESCE |
DISTINCT hiding a bad join | Fix the join |
ORDER BY on un-indexed column with small LIMIT | Index the sort column |
EXPLAIN ANALYZE output before guessing at indexes.Paste the query (and optionally DDL + EXPLAIN output) and I will explain immediately.