Postgres and MySQL

An EXPLAIN plan visualizer that finds the slow part.

Paste a Postgres or MySQL EXPLAIN plan in JSON and LetDraw's EXPLAIN plan visualizer draws it as a tree, one box per plan node with its cost, rows and timing. A heat map colours each node by the time or cost it adds itself, so the slow query step lights up red.

Slow query · EXPLAIN ANALYZE
Sort cost 1290 rows 120 52.6 ms Nested Loop cost 1240 rows 120 49.8 ms Seq Scan · orders cost 912 rows 4800 38.2 ms Index Scan · users cost 8 rows 1 9.6 ms less time more time
Step by step

From query plan to picture in four steps

Run EXPLAIN as JSON, paste it, and read the tree instead of the wall of text.

  1. Get the plan as JSON

    In Postgres run EXPLAIN (FORMAT JSON) before your query, or EXPLAIN (ANALYZE, FORMAT JSON) for real timings. In MySQL use EXPLAIN FORMAT=JSON.

  2. Paste it into Generate from Code

    Open Generate from Code (a Pro feature) from the More tools menu and paste. The plan is recognised automatically and a live preview appears.

  3. Read the heat map

    Green nodes add little, red nodes add the most. Lay the tree out top-down or left-right, whichever reads better.

  4. Annotate and share

    Insert the tree, add a note on the red box with your fix, then share a link or export as PNG, SVG or PDF.

Where the time really goes

Heat-mapped by self time, not by totals

Postgres reports cost and time cumulatively, so the root of a plan always looks the most expensive. This EXPLAIN plan visualizer subtracts each node's children and colours by what the node adds itself, from green through amber to red. Each box shows the node type and the table, index or function it works on, plus cost, rows and, with ANALYZE, the time in milliseconds across all loops.

  • Postgres EXPLAIN in JSON format, with or without ANALYZE
  • MySQL EXPLAIN FORMAT=JSON, showing each table with its access type, cost and rows
  • Runs in your browser, so the plan and your table names stay on your machine
Try it now
EXPLAIN (ANALYZE, FORMAT JSON) SELECT * FROM orders o JOIN users u ON ...; [{ "Plan": { "Node Type": "Nested Loop", "Actual Total Time": 49.8, "Plans": [ ... ] }}] -- MySQL: EXPLAIN FORMAT=JSON Nested Loop 49.8 ms Seq Scan orders Index Scan users 38.2 ms here
What people use it for

Make slow query plans easy to discuss

A raw plan is something one person deciphers alone; a coloured tree is something the whole team understands.

Slow query triage

Find the sequential scan or the expensive join in seconds instead of scrolling through nested JSON.

Before and after an index

Paste both plans on one canvas and show exactly which node turned from red to green.

Code reviews

Attach the plan of a new query to the pull request so reviewers see its cost, not just its SQL.

Incident write-ups

Export the heat-mapped tree as PNG, SVG or PDF and put the culprit right in the post-mortem.

Developer and DBA handoffs

Share one board where both sides comment on the same plan nodes in real time.

Learning query planners

See how joins, scans and sorts nest inside each other and why the planner chose them.

Questions

EXPLAIN plan visualizer FAQ

Which EXPLAIN output can I paste?
Postgres EXPLAIN (FORMAT JSON), with or without ANALYZE, and MySQL EXPLAIN FORMAT=JSON. The plain text output of EXPLAIN is not supported, so ask for JSON.
Should I use EXPLAIN ANALYZE?
When you can afford to run the query, yes. With ANALYZE the heat map follows measured time; without it, the colours follow the planner's estimated cost.
Does my query plan leave the browser?
No. The plan is parsed and laid out entirely in your browser. Only the diagram you insert is saved, like any other drawing.
Is it free?
Generate from Code, which turns an EXPLAIN plan into a diagram, is part of Pro and Enterprise. The Free plan still gives you the full canvas, every diagram type and export to PNG, SVG and PDF, with no credit card.

Let the bottleneck introduce itself.

Open LetDraw, paste your EXPLAIN plan as JSON and see where the query spends its time.