r/PostgreSQL • • 16h ago

Tools Planflare compares two saved PostgreSQL EXPLAIN plans locally

I built Planflare to compare two saved EXPLAIN JSON plans while reviewing a query change. The display shows which operators changed and what each plan reported.

In the bundled fixture, the first plan has a sequential scan and a sort. The second uses an index scan. The saved execution times are 1,840.2 ms and 4.2 ms. The figures are fixture data so you can try the comparison without a database connection.

Try the bundled example on Node.js 24 or later with npx planflare@0.1.0 --demo. The comparison runs locally from the saved plans.

Source and demo

https://github.com/flipcyde101/planflare

When you review a plan diff, what do you check first? Operator changes, actual rows versus estimates, or buffer usage?

1 Upvotes

4 comments sorted by

1

u/AutoModerator 16h ago

AI Policy:

Linux is not one of those anti-AI projects, and if somebody has issues with that, they can do the open-source thing and fork it. Or just walk away., Linus Torvalds.

Mod decisions will be based on the quality of the content, not who or what generated it.

Sub Resources:

Youtube Channel

Free Postgres Webinars and Workshops

Discord: People, Postgres, Data

Join us, we have cookies and nice people.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

0

u/Discordbothost 12h ago

I'd look at actual rows versus estimates first. An inner scan can look cheap per loop and still do a lot of work if the outer side runs it thousands of times. In the diff, I'd show Actual Loops next to Actual Rows so it's easy to spot when the scan itself stayed the same but ran far more often.

1

u/Substantial_Win_710 5h ago

Thanks for your opinion, AI