EXPLAIN Plan Visualizer.
Visualize PostgreSQL and MySQL EXPLAIN plans as a tree with time, cost and row-estimate warnings.
Runs in your browserPaste a plan or load the example.
About EXPLAIN Plan Visualizer
EXPLAIN Visualizer turns the wall of text that EXPLAIN prints into a readable tree, so you can find the slow part of a query in seconds. It reads PostgreSQL plans in the default text format and in FORMAT JSON, MySQL's EXPLAIN FORMAT=JSON, and the tree format printed by MySQL 8 EXPLAIN ANALYZE; psql table borders and the row count footer are cleaned up automatically. Every node is shown with its operation, the table and index it touches, the estimated cost and rows, and, for EXPLAIN ANALYZE, the actual rows, loops and time. The key number is self time: PostgreSQL reports inclusive times per loop, so the tool multiplies by loops and subtracts the children to show how much time each node spent on its own work, then draws a bar with its share of the total execution time. That is usually where the fix is. The findings list points out the patterns that most often explain a slow query: a sequential or full table scan that throws away thousands of rows after filtering, a row estimate that is off by ten times or more, which means stale statistics, a sort that spilled to disk, MySQL filesort or temporary tables, and nested loops whose inner side runs thousands of times. For example, a Seq Scan on orders with Rows Removed by Filter: 50000 is flagged with a suggestion to index the filtered column. Run EXPLAIN (ANALYZE, BUFFERS) for the richest input. Plans may contain table names and literal values, and they never leave your browser.
How to Use
- Run EXPLAIN ANALYZE (PostgreSQL), EXPLAIN FORMAT=JSON or EXPLAIN ANALYZE (MySQL) and copy the output.
- Paste it; the format is detected and the plan tree appears with time bars.
- Start with the node with the highest self time and read the findings below the tree.
Frequently Asked Questions
Which formats are supported?
PostgreSQL text and FORMAT JSON output of EXPLAIN and EXPLAIN ANALYZE, MySQL EXPLAIN FORMAT=JSON, and the MySQL 8 tree format from EXPLAIN ANALYZE or EXPLAIN FORMAT=TREE. The classic tabular MySQL EXPLAIN output is not supported.
What is self time?
The time a node spent excluding its children. PostgreSQL prints inclusive time per loop, so the tool computes actual time × loops minus the children's total. Parallel workers can make the numbers approximate.
Why are there no times in my plan?
Plain EXPLAIN only estimates. Use EXPLAIN ANALYZE to execute the query and record real times and row counts; wrap data-changing statements in a transaction you roll back.
Is the plan uploaded?
No. It is parsed and drawn in your browser.
Related Tools
Draw an entity-relationship diagram from CREATE TABLE statements or DBML and download it as SVG.
Format and beautify SQL queries.
Translate mongo shell find() queries to SQL SELECT and SQL back to find() or aggregate().
Convert a SELECT statement into Laravel Query Builder and Eloquent code.
Turn CREATE TABLE statements from MySQL, PostgreSQL or SQLite into a Laravel migration.