1.7k stars · PostgreSQL licence (read from the LICENSE file: the permissive BSD-style text PostgreSQL itself uses) · 1.4.3 (2026-06-19), read from /releases/latest; the date showed no year and falls in the past, so 2026 · Track this in Scout
Creates an index that does not really exist, so PostgreSQL can tell you whether a real one would be used.
▶Repo detailsthe review · specs · pros & cons · install
What it is
A PostgreSQL extension. An extension is an add-on installed into the database server itself, and this one is small and adds no background work. You call one function with the text of the index you are thinking about. Nothing is written to disk. From then on, in your session only, the query planner behaves as though the index exists, so EXPLAIN shows you whether it would be chosen and what it would cost.What it is good for. Anyone with a table that has grown past the point where experiments are cheap. The problem it removes is the guess. Instead of building three candidate indexes overnight and measuring, you try twenty in ten minutes and build the one that wins. It completes a chain this radar has been building for a month: pgBadger from Edition 18 finds which queries are slow, pev2 from Edition 20 explains why one of them is slow, and this tells you whether the obvious fix would actually work. Grasppy's data is in PostgreSQL, so this is the one entry today that could make a page faster this week.
- The pretend index costs nothing. Nothing is written, nothing is locked, and other people using the database are not affected.
- It only exists inside your own session, so you can experiment on the real database without changing it for anybody else.
- The PostgreSQL licence is as permissive as MIT, and the code is small enough to read in an afternoon.
- It tells you whether the planner would choose the index, not how fast the query would actually run. Those are close, and they are not the same.
- Installing it means compiling a small extension on the database server, which needs the PostgreSQL development headers. On a managed database you may not be allowed to.
- It supports plain B-tree indexes best. More unusual index types are partly supported or not at all.
- ankane/dexter
Reads your slow queries and suggests indexes on its own, and it uses HypoPG underneath to test them, so the two are a pair rather than a choice.
Track this in Scout - powa-team/powa
Collects query statistics over time and draws them in a web page, and it can call HypoPG to test a suggestion from inside that page.
Track this in Scout
dalibo/pev2Draws a query plan as a picture and marks where the database guessed the number of rows badly, which is usually how you find out an index is missing.
Track this in Scout
# On Debian or Ubuntu, with the PostgreSQL apt repository enabled: sudo apt install postgresql-17-hypopg # match the number to your version # Or from source; you need the PostgreSQL header files first: sudo apt install postgresql-server-dev-17 git clone https://github.com/HypoPG/hypopg.git cd hypopg make && sudo make install
