HypoPG/hypopg
FreeHypothetical Indexes for PostgreSQL
About HypoPG/hypopg
HypoPG is a PostgreSQL extension that enables the creation of hypothetical (virtual) indexes. These indexes do not consume disk space or CPU resources to create, allowing developers and DBAs to test whether an index would improve query performance without actually building it. The extension is compatible with PostgreSQL 9.2 and above, and provides SQL functions such as hypopg_create_index to define hypothetical indexes using standard CREATE INDEX syntax, and hypopg_list_indexes to inspect them. Hypothetical indexes are local to the backend that creates them, so concurrent sessions remain unaffected. This makes HypoPG a valuable tool for query optimization and index planning in development and staging environments.
Key Features
Pros & Cons
- Zero resource cost for creating virtual indexes
- Safe to test index strategies without risk
- Simple integration via SQL functions
- Compatible with a wide range of PostgreSQL versions
- Isolated per session for safe experimentation
- Hypothetical indexes are session-local and not persistent
- Some CREATE INDEX options (e.g., index name) are ignored
- Requires PostgreSQL header files for installation