一键导入
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.