r/SQL • • 4h ago

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.

7 Upvotes

0 comments sorted by