pg_index_stats
Create extended statistics on an index manually or automatically
pg_index_stats · Create extended statistics on an index manually or automatically
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101559 | pg_index_stats | pg_index_stats | 0.2 | ADMIN | MIT | C |
Usage
Sources:
- Official upstream README
- Official extension control file (pg_index_stats.control)
- Official extension SQL (pg_index_stats–0.2.sql)
pg_index_stats — Lightweight extension for PostgreSQL that generates extended statistics based on index definitions. It introduces dependency of the statistics on the corresponding index. Use it when administering or automating the database behavior described above. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
pg_index_stats_build(idxname text, mode text DEFAULT 'mcv, ndistinct')is an extension function and returnsboolean.pg_index_stats_rebuild()is an extension function and returnsinteger.pg_index_stats_remove()is an extension function and returnsinteger.
Requirements and Caveats
- The reviewed control file declares default version
0.2. - The control file marks the extension as relocatable.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.