PostgreSQL EXPLAIN Plan Visualizer

Turns EXPLAIN or EXPLAIN ANALYZE output, as text or FORMAT JSON, into an indented plan tree with per-node time or cost bars, row-estimate error factors and automatic findings.

Use the tool

Why this tool exists

A PostgreSQL query plan is hard to read as text, especially with nested loops, hashes and sorts, and the real cost is often hiding in one node. Pasting the plan here gives you a tree with each node's own time, not time cumulated from its children, shown as a bar, so the hot spot stands out. The tool compares estimated and actual row counts and highlights big mismatches, which usually point to stale statistics. It also flags sequential scans that discard most rows, sorts that spill to disk, hashes that run in multiple batches and nested loops with many iterations. Plans can contain table names and filter values, so doing this in your browser, without uploading, is a good fit.

How to use it

  1. Run EXPLAIN (ANALYZE) on your query and copy the output, as text or FORMAT JSON.
  2. Paste the plan into the input box.
  3. Read the tree to find the nodes with the highest time, then check the findings listed.

Frequently asked questions

Which plan formats can I paste?

The default text format and FORMAT JSON. EXPLAIN ANALYZE output is best, because it contains real times and row counts. A plain EXPLAIN shows costs only.

What is exclusive time?

The time spent in a node itself, without the time of its children. It shows which step really costs the most.

What does the row-estimate error factor mean?

It compares the planner's estimated rows with the actual rows. Large differences suggest stale statistics, and often lead to poor plan choices. Try ANALYZE on the table.

Does it tell me exactly how to fix the query?

No. It points to likely problems such as sequential scans or disk sorts. You still decide whether an index, a rewrite or better statistics is the right fix.