hypopg
hypopg : Hypothetical indexes for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2790 | hypopg | hypopg | 1.4.4 |
FEAT | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| Need By | index_advisor |
| See Also | online_advisor pg_qualstats index_advisor pg_hint_plan pg_stat_plans plan_filter pg_track_optimizer pg_strom pg_orca pg_regresql |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG | 1.4.4 |
18 17 16 15 14 | hypopg |
- |
| RPM | PGDG | 1.4.4 |
18 17 16 15 14 | hypopg_$v |
- |
| DEB | PGDG | 1.4.4 |
18 17 16 15 14 | postgresql-$v-hypopg |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| el8.aarch64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| el9.x86_64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| el9.aarch64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| el10.x86_64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| el10.aarch64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| d12.x86_64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| d12.aarch64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| d13.x86_64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| d13.aarch64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| u22.x86_64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| u22.aarch64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| u24.x86_64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| u24.aarch64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| u26.x86_64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
| u26.aarch64 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 | PGDG 1.4.4 |
Source
github.com/HypoPG/hypopg
Install
Make sure PGDG repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
HypoPG lets you create hypothetical (virtual) indexes that exist only in the current session and are considered by EXPLAIN (without ANALYZE) for query planning. This enables testing the impact of indexes without the cost of actually creating them.
Functions
| Function | Description |
|---|---|
hypopg_create_index(query text) |
Create a hypothetical index using CREATE INDEX syntax |
hypopg_list_indexes |
List all hypothetical indexes in the session |
hypopg_drop_index(oid) |
Drop a specific hypothetical index by OID |
hypopg_reset() |
Drop all hypothetical indexes |
hypopg() |
Return hypothetical indexes in pg_index-like format |
Workflow
Create a test table and check the baseline plan:
Create a hypothetical index:
Check the plan with the hypothetical index:
List and manage hypothetical indexes:
Limitations
- Only
EXPLAINwithoutANALYZEwill consider hypothetical indexes - Hypothetical indexes exist only in the current backend session
- Other concurrent connections are not affected
- Index names and some CREATE INDEX options are ignored
1.4.4 and Upgrade Boundaries
Upstream 1.4.4 fixes hypothetical index naming for large OIDs, dependent-object invalidation, INCLUDE-column limits and failed EXPLAIN state, with additional PostgreSQL 19 compatibility fixes. Hypothetical indexes remain local to one backend and affect EXPLAIN without ANALYZE. No extension update scripts are provided: after installing matching files, drop and recreate the extension in each database. Reconnect or reset the backend to discard hypothetical state. This upstream release does not assert a matching packaged build.