- Documentation
RDS for PostgreSQL
User guide
Extensions
Memory hypothetical index (hypopg)
Extensions
Memory hypothetical index (hypopg)
Memory hypothetical index (hypopg)
hypopg is a PostgreSQL extension that supports creating hypothetical indexes in memory. These indexes exist in memory and are not written to disk, so they do not occupy physical storage space nor incur actual I/O overhead.
Its core value lies in allowing database administrators (DBAs) and developers to safely and cost-effectively evaluate the potential optimization effects of new indexes on specific queries without modifying production environment data structures or affecting online service performance. By analyzing the query plan with EXPLAIN, it is possible to determine whether the optimizer would choose to use this hypothetical index, providing a basis for deciding whether to create a real index.
- Applicable scope: hypothetical indexes are visible to the optimizer only during query plan analysis with EXPLAIN, while EXPLAIN ANALYZE and actual query execution do not use them.
- Session isolation: hypothetical indexes are effective only in the current database session that created them. Other concurrent sessions cannot perceive or use them.
- Lifecycle: creating hypothetical indexes does not generate WAL (write-ahead log) records, so all created hypothetical indexes are automatically lost when the database service restarts or the session ends.
- Supported type: only supports creating four types of hypothetical indexes: B-tree, BRIN, HASH, and BLOOM (using BLOOM index requires the bloom extension installed).
Create and delete extension
Execute the following SQL command to create the hypopg extension and verify the installation's success by querying the pg_extension view.
Execute the following command to delete the extension.
Function enabling and configuration
Before using the hypothetical index function, enable and configure it through the GUC parameter.
The following table summarizes the core functions and views provided by the hypopg extension and their usage.
Last updated: 2026.05.09 16:35:06