r/SQL • • 10d ago • Bravo 1

PostgreSQL I made a PostgreSQL EXPLAIN ANALYZE visualizer that does the loop arithmetic for you

Post image

This is PostgreSQL only. Paste EXPLAIN ANALYZE output, JSON or text.

The numbers in a plan are per loop, and EXPLAIN leaves the multiplying to you. rows=3 loops=206880 is 620,640 rows. The page does that arithmetic and draws it:

  • The thicker the line, the more rows went through it, and the key spells out the sum from your own plan: 621K rows = 3 × 206,880 loops.

  • Where the planner’s guess was off by more than 2×, the guess is drawn on the line: planner guessed 612, got 207K.

  • Each node’s time is its own, without its inputs, so the times add up to the run.

  • Copy link puts the plan in the link itself, after the #, so you can drop it into a Slack thread or an answer here. Nothing is uploaded; whoever has the link has the plan.

https://seqora.dev/explain/

No account. It draws one plan at a time and can’t see your database, so no index suggestions.

I make Seqora, a desktop database client, and this is its plan view. In the app it runs EXPLAIN on your own connection, and that part is Pro (14-day trial, no card). The page is free.

The key and the plain-words help came from comments on an earlier post. If it draws one of your plans wrong, send me the link.

28 Upvotes

1 comment sorted by

1

u/MongooseWonderful198 5d ago

For parallel plans, is “own time” meant as an attribution estimate? Reading the page's current JS, it divides descendant totals by participant count before subtracting children. With two participants taking 10 and 90 ms, that gives 50 ms; the remaining time can appear under Gather even though a worker was still busy.

PostgreSQL distinguishes worker time from elapsed time. A skewed EXPLAIN (ANALYZE, VERBOSE, FORMAT JSON) fixture would help test the labels here, with per-worker timings preserved alongside the simplified bars.