Skip to content
gohacks.dev
Databases

PostgreSQL EXPLAIN ANALYZE Reader

Paste PostgreSQL EXPLAIN ANALYZE output and see which plan nodes take the time, where row estimates are off and which sorts and hashes spill to disk.

Free · No sign-up · Your inputs stay in your browser

Input

Read a PostgreSQL EXPLAIN ANALYZE plan

Output

6 plan nodes

NodeSelf msShareRows (est)
Hash Join192.1046.6%498,211 (500,000)
Seq Scan on orders o148.3336.0%498,211 (500,000)
HashAggregate71.3117.3%97 (100)
Hash0.470.1%1,000 (1,000)
Seq Scan on customers c0.310.1%1,000 (1,000)
Sort0.050.0%97 (100)

Planning Time: 0.412 ms; Execution Time: 412.701 ms

Time per node is exclusive: the node's own actual time × loops, minus its children's. That is where the query spends its time; the top node's inclusive time is just the total. Run with EXPLAIN (ANALYZE, BUFFERS) to see whether the time went to reading from disk.

Runs in this browser. Nothing you paste is sent to a server.

Read exclusive time, not the top line

The time on each line of EXPLAIN ANALYZE includes everything below it, and is per loop. Multiplying by loops and subtracting the children gives the time the node itself spent, which is where to look. The Using EXPLAIN chapter explains every field.

Misestimates cause bad plans

The planner picks join methods from estimated row counts. When it expects 10 rows and gets 100,000, it chooses a nested loop that runs 100,000 times. ANALYZE table refreshes statistics; for correlated columns, CREATE STATISTICS teaches the planner how they relate.

Share

Frequently asked questions

What is the difference between EXPLAIN and EXPLAIN ANALYZE?
EXPLAIN shows the plan and estimates without running the query. EXPLAIN ANALYZE runs it and adds actual times and row counts. Wrap data-changing statements in BEGIN and ROLLBACK when analysing them.
What does Rows Removed by Filter mean?
Rows the node read and then discarded because they failed the WHERE condition. A large number on a Seq Scan usually means an index on the filtered column would help.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools