Skip to content
Development
Command

/explain-plan

Generate and interpret a SQL query execution plan in plain language.

From plugin
rohitg00-claude-code-toolkit
2.5k199 skills138 agents199 commands
Install
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/explain-plan

Context preview

What this command does when you run it.

Generate and interpret a SQL query execution plan in plain language.

Command definition

explain-plan.md

/explain-plan - Explain Query Execution Plan

Generate and interpret a SQL query execution plan in plain language.

Steps

1. Take the SQL query from the user input 2. Determine the database engine (PostgreSQL, MySQL, SQLite, SQL Server) 3. Run EXPLAIN or EXPLAIN ANALYZE with the appropriate syntax for the engine 4. Parse the execution plan output into structured components 5. Identify each operation: Sequential Scan, Index Scan, Nested Loop, Hash Join, Sort 6. Explain each step in plain language: what table is read, how it is filtered 7. Highlight expensive operations: full table scans, large sort operations, hash joins 8. Calculate the cost percentage of each step relative to total query cost 9. Identify the critical path (most expensive sequence of operations) 10. Suggest specific improvements for the most costly operations 11. Estimate memory usage and temporary disk usage from the plan 12. Present the explanation as a step-by-step narrative

Rules

  • Translate database-specific terminology into plain English
  • Highlight operations that scan more than 1000 rows without an index
  • Show estimated vs actual rows to identify cardinality estimation errors
  • Explain the difference between estimated cost and actual execution time
  • Identify parallel query opportunities if the database supports them
  • Note when the planner chose a suboptimal plan due to stale statistics
  • Recommend ANALYZE/VACUUM if statistics appear outdated
Read more
Ships withrohitg00-claude-code-toolkit

The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.

Get the whole plugin