SQL EXPLAIN Visualizer
Paste your EXPLAIN or EXPLAIN ANALYZE output and see your query execution plan as a visual tree. Spot full table scans, index usage, nested loops, and performance bottlenecks — instantly.
📊 Execution Plan
💡 Performance Insights
Related Tools
What Is SQL EXPLAIN and Why Visualize It?
EXPLAIN is a command available in MySQL, PostgreSQL, and SQLite that reveals the execution plan of a query — the step-by-step strategy the database engine uses to scan tables, join data, filter rows, and sort results. Raw EXPLAIN output is dense, tabular text that takes effort to decipher. This free online SQL EXPLAIN Visualizer transforms that text into an interactive, color-coded tree diagram so you can spot full table scans (red), index usage (green), joins (blue), and sort operations (orange) at a glance within seconds.
How to Use the Online SQL Execution Plan Analyzer
- Run
EXPLAIN SELECT ...orEXPLAIN ANALYZE SELECT ...in your database client - Copy the full output — the tool auto-detects MySQL, PostgreSQL, or SQLite format
- Paste into the editor above and click Analyze Plan (or press Ctrl+Enter)
- Explore the tree: expand nested operations, read cost and row estimates, check the Performance Insights panel
Supported SQL Dialects
MySQL EXPLAIN
Parses tabular output with id, select_type, table, type, key, rows, Extra columns. Flags ALL scans, index lookups, Using filesort, and Using temporary.
PostgreSQL EXPLAIN
Handles both EXPLAIN (estimated costs) and EXPLAIN ANALYZE (actual timings). Renders tree-format output with cost, rows, width, and loop counts.
SQLite EXPLAIN
Reads opcode-level addr, opcode, p1-p5 output. Useful for understanding low-level VDBE instruction sequences.
Common Performance Issues to Look For
- Full Table Scans (Seq Scan / type=ALL) — scanning every row without an index. Add indexes on WHERE, JOIN, and ORDER BY columns
- Nested Loop Joins on large tables — may benefit from hash joins. Verify join columns are indexed
- Sort Operations with high row counts — consider composite indexes to cover ORDER BY clauses
- High Row Estimates (10K+) — add LIMIT or more selective WHERE filters to reduce scanned row volume
- Using filesort / Using temporary in MySQL — query cannot use an index for sorting, causing disk I/O
Tip: Use EXPLAIN ANALYZE over plain EXPLAIN when tuning — it executes the query and shows actual (not estimated) timings per operation, row counts, and loop iterations, which is critical for spotting the real bottlenecks.
Frequently Asked Questions
What is SQL EXPLAIN and how does the visualizer help?
EXPLAIN is a command that shows the query execution plan — how the database engine retrieves rows, joins tables, and filters results. The raw output is dense terminal text. Our visualizer turns it into a color-coded tree diagram so you can spot full table scans, index usage, nested loops, and bottlenecks at a glance without deciphering raw text.
How do I use the SQL EXPLAIN Visualizer online?
Run EXPLAIN or EXPLAIN ANALYZE before your SQL query in MySQL, PostgreSQL, or SQLite. Copy the full output, paste it into the editor, and click Analyze Plan or press Ctrl+Enter. The tool auto-detects your database dialect and renders an interactive tree with color-coded operation nodes and actionable performance insights.
What databases does this execution plan analyzer support?
The tool supports MySQL (tabular format with id, select_type, table, type, key, rows, Extra columns), PostgreSQL (tree-format EXPLAIN and EXPLAIN ANALYZE with cost, actual time, rows, and loops), and SQLite (opcode-level EXPLAIN with addr, opcode, p1-p5). It auto-detects the dialect from your pasted output.
How do I read a SQL execution plan tree?
Read the tree from innermost (leaf) nodes outward. Each node is one operation: red = full table scan (slow), green = index scan/seek (fast), blue = join, orange = sort. The cost field shows estimated I/O and CPU cost. Focus on red nodes first — they represent operations scanning every row, which are the primary optimization targets.
Is my EXPLAIN output safe? Does data leave my browser?
Yes, completely safe. All parsing, analysis, and tree rendering runs 100% in your browser using client-side JavaScript. Your EXPLAIN output never leaves your device — no server-side processing, no logging, no data collection. You can disconnect from the internet after loading and the tool works fully offline.
What is the difference between EXPLAIN and EXPLAIN ANALYZE?
EXPLAIN only estimates: it shows the plan the optimizer intends to run, with predicted costs and row counts, and never executes the statement. EXPLAIN ANALYZE actually runs the query and reports real elapsed time, real row counts, and loop iterations alongside the estimates. Comparing the two is how you catch bad cardinality estimates — in PostgreSQL a huge gap between estimated rows and actual rows usually means stale statistics, so run ANALYZE on the table. In MySQL the equivalent is EXPLAIN ANALYZE (8.0.18+) or the FORMAT=TREE option.
Does this tool work with Oracle, SQL Server or DB2 plans?
Not currently — the parser reads MySQL, PostgreSQL and SQLite formats, which cover the plans most developers paste while tuning day to day. Oracle DBMS_XPLAN, SQL Server SHOWPLAN_XML and DB2 explain tables use their own XML or tabular layouts that need a separate parser. If you paste one of those formats the tool tells you it could not detect a dialect instead of rendering a wrong tree.
Related Guides
In-depth explainers for the problems this tool solves: