Say exactly what was proved
A hypothetical index cannot be run against, so an index proof compares the planner's cost estimates, not time, and every result says so. A suggestion that does not move the plan is shown as unproven instead of as advice.
A PostgreSQL query optimiser that explains slow plans and tests proposed fixes with hypothetical indexes before you change the database.
Solo, Jul 2026
99.5%
lower estimated cost on the demo query, shown before any index was built
4,000,000
orders in the demo table, read in full to return 621 rows
979
checks: 514 unit, 270 against the API, 195 in a real browser
7
kinds of rewrite it writes for you, each checked to return the same rows
Plan visualisers are a solved and crowded space. What nothing closes is the loop: read a plan, guess at an index, build it, wait, measure, repeat. I wanted a tool that proves the fix before you build anything.
It all reduces to one idea. Plan the query against a world, change one thing about that world (a hypothetical index, a setting, a rewritten query), plan it again, and compare the two plans.
There are three parts. The core is pure analysis with no I/O: it reads a plan, runs thirteen findings rules and compares two plans. The agent is the only part that holds a database connection, and everything it runs goes inside a read-only transaction with a time limit and is always rolled back. The web UI only ever talks to the agent.
Choose a query plan and an index to test.
A hypothetical index cannot be run against, so an index proof compares the planner's cost estimates, not time, and every result says so. A suggestion that does not move the plan is shown as unproven instead of as advice.
HypoPG keeps its state for the session, not the transaction. A pooled connection handed back with a phantom index would quietly change every later plan, so cleanup always runs, with a savepoint around each EXPLAIN so one failed query cannot stop it.
The parser counts positions in bytes and JavaScript counts in UTF-16 units, so a single é shifts everything after it by one. All splicing is done on bytes, and a rewrite is offered only if parsing it gives exactly the intended tree.
A rewrite is called proven only when the schema guarantees it and both versions return the same rows, compared in full within one statement. Under LIMIT, with volatile functions, or above 100,000 rows it refuses to judge.
Three identical runs once produced two “the plan got worse” entries, because timing is noisy. History and the CI gate now look only at plan shape and estimated cost, which also keeps a committed baseline meaningful on another machine.
Measuring a query means running it, so no single check is trusted: a filter on the text, a read-only transaction, a time limit, and a read-only database role whose presence is reported. The code says plainly which layer is the weakest.