pg_table_range
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_table_range | 0.1.2 | OLAP | MIT | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2570 | pg_table_range | No | Yes | No | Yes | No | No | - |
Experimental. 0.1.2 fixes missing rows and backend crashes. From 0.1.1: install new binaries, restart all backends, UPDATE extension, REINDEX each table_range index (parent for partitioned tables); old summaries are ignored until rebuilt.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.2 | 1817161514 | pg_table_range | - |
| RPM | PIGSTY | 0.1.2 | 1817161514 | pg_table_range_$v | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.1.2 el8.x86_64.pg18 : pg_table_range_18 pg_table_range_18-0.1.2-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.1.2 el8.x86_64.pg17 : pg_table_range_17 pg_table_range_17-0.1.2-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.1.2 el8.x86_64.pg16 : pg_table_range_16 pg_table_range_16-0.1.2-1PGSTY.el8.x86_64.rpm
| N/A | N/A |
| el8.aarch64 | PIGSTY 0.1.2 el8.aarch64.pg18 : pg_table_range_18 pg_table_range_18-0.1.2-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.1.2 el8.aarch64.pg17 : pg_table_range_17 pg_table_range_17-0.1.2-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.1.2 el8.aarch64.pg16 : pg_table_range_16 pg_table_range_16-0.1.2-1PGSTY.el8.aarch64.rpm
| N/A | N/A |
| el9.x86_64 | PIGSTY 0.1.2 el9.x86_64.pg18 : pg_table_range_18 pg_table_range_18-0.1.2-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.1.2 el9.x86_64.pg17 : pg_table_range_17 pg_table_range_17-0.1.2-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.1.2 el9.x86_64.pg16 : pg_table_range_16 pg_table_range_16-0.1.2-1PGSTY.el9.x86_64.rpm
| N/A | N/A |
| el9.aarch64 | PIGSTY 0.1.2 el9.aarch64.pg18 : pg_table_range_18 pg_table_range_18-0.1.2-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.1.2 el9.aarch64.pg17 : pg_table_range_17 pg_table_range_17-0.1.2-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.1.2 el9.aarch64.pg16 : pg_table_range_16 pg_table_range_16-0.1.2-1PGSTY.el9.aarch64.rpm
| N/A | N/A |
| el10.x86_64 | PIGSTY 0.1.2 el10.x86_64.pg18 : pg_table_range_18 pg_table_range_18-0.1.2-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.1.2 el10.x86_64.pg17 : pg_table_range_17 pg_table_range_17-0.1.2-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.1.2 el10.x86_64.pg16 : pg_table_range_16 pg_table_range_16-0.1.2-1PGSTY.el10.x86_64.rpm
| N/A | N/A |
| el10.aarch64 | PIGSTY 0.1.2 el10.aarch64.pg18 : pg_table_range_18 pg_table_range_18-0.1.2-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.1.2 el10.aarch64.pg17 : pg_table_range_17 pg_table_range_17-0.1.2-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.1.2 el10.aarch64.pg16 : pg_table_range_16 pg_table_range_16-0.1.2-1PGSTY.el10.aarch64.rpm
| N/A | N/A |
| d12.x86_64 | N/A | N/A | N/A | N/A | N/A |
| d12.aarch64 | N/A | N/A | N/A | N/A | N/A |
| d13.x86_64 | N/A | N/A | N/A | N/A | N/A |
| d13.aarch64 | N/A | N/A | N/A | N/A | N/A |
| u22.x86_64 | N/A | N/A | N/A | N/A | N/A |
| u22.aarch64 | N/A | N/A | N/A | N/A | N/A |
| u24.x86_64 | N/A | N/A | N/A | N/A | N/A |
| u24.aarch64 | N/A | N/A | N/A | N/A | N/A |
| u26.x86_64 | N/A | N/A | N/A | N/A | N/A |
| u26.aarch64 | N/A | N/A | N/A | N/A | N/A |
Build
You can build the RPM packages for pg_table_range using pig build:
Install
You can install pg_table_range directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
- Upstream README
- Version and PostgreSQL feature matrix
- Planner-hook and GUC registration
- 0.1.2 upgrade and correctness fixes
pg_table_range is an experimental PostgreSQL 16–18 extension for planning-time partition pruning on columns that are not partition keys. Its table_range index access method stores each partition’s actual scalar minimum and maximum, range extent, or PostGIS geometry extent. A planner hook removes a partition only when its summary proves that the partition cannot match.
Basic use
Build the summary index on a partitioned table and compare plans with representative predicates:
The index is never selected to scan rows; it owns compact summaries used by the planner. Inserts widen summaries automatically. Deletes remain safe but can leave them wider than live data until REINDEX tightens them; VACUUM does not rebuild summaries.
Supported pruning predicates include scalar comparisons, BETWEEN, null tests, constant IN or ANY lists, and overlap for range and PostGIS geometry types. Unsupported expressions conservatively keep the partition.
Upgrade from 0.1.1
Version 0.1.2 fixes missing rows and backend crashes in 0.1.1. Install the new binaries and restart PostgreSQL so no backend still runs the old code. Then update the extension and rebuild every table_range index, using the parent index for partitioned tables:
Old summaries are ignored until rebuilt, keeping all partitions rather than risking incorrect pruning. Partial indexes are rejected. REINDEX is also the way to tighten summaries after deletes.
Caveats
- Upstream explicitly labels the project experimental and heavily AI-driven. Qualify correctness, crash recovery, upgrades, and planner behavior on production-shaped data before adoption.
- Planning cost is linear in the partition count. Native partition-key pruning is far cheaper; use pg_table_range only for selective non-key predicates where the execution savings justify planning work.
- Index creation and non-key planning lock every partition. With thousands of partitions, the default max_locks_per_transaction can fail with out-of-shared-memory errors; increasing it consumes shared memory and requires a restart.
- Deletes can reduce selectivity until maintenance rebuilds or tightens summaries. An invalid table_range index silently disables its pruning.
- The control file requires superuser installation. Limit table and index DDL privileges and test the Rust/pgrx build for the exact PostgreSQL major version.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)