Free · no sign-up · runs in your browser
PostgreSQL EXPLAIN visualizer
Paste what
EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON) returns, or the
text EXPLAIN ANALYZE prints. The plan is drawn below,
with the slowest node and the worst row estimate marked.
Your plan stays in this browser tab. The page reads and draws it here, and nothing you paste is sent anywhere.
The visualizer needs JavaScript. It reads EXPLAIN output, JSON or text, and draws the plan as rows flowing from the tables to the result, with each node's own time, rows against the planner's estimate, loops, buffers and the rows its filter removed.
Getting a plan to paste
Put this in front of the query, in psql or any SQL editor:
EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON)
SELECT ...;
ANALYZE runs the statement for real. For an
UPDATE or a DELETE, run it between
BEGIN and ROLLBACK. Without
ANALYZE the page draws the planner's estimates only,
with no times and no actual rows.
The default text format works too. psql's
QUERY PLAN header, the + at the end of
each line and the row count under the plan are ignored.
Reading the drawing
Rows move left to right: tables enter on the left and the result leaves on the right. A band is as wide as the rows that crossed it, over every loop. When the planner's estimate is off by more than 2×, it is drawn on the band as two dashed lines, on the band where the error starts.
Each node's time is its own, without its inputs, so the times add up to the run. The list under the drawing has every node, nested as EXPLAIN prints it. The Plan tab page in the Guide reads one plan mark by mark.
The page cannot see your database. It shows what the plan holds and nothing else: no table sizes, indexes or column statistics.
Each node is explained in the Guide:
This is the Plan tab from Seqora, a desktop database client. In the app, the Plan tab runs EXPLAIN from the SQL editor against your own database. It is part of Pro, which has a 14-day trial.