istore
istore : Integer key/value types with arithmetic, aggregation, and GIN indexing
Overview
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | hstore collection intarray aggs_for_arrays |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.12 |
18 17 16 15 14 | istore |
- |
| RPM | PIGSTY | 0.1.12 |
18 17 16 15 14 | istore_$v |
- |
| DEB | PIGSTY | 0.1.12 |
18 17 16 15 14 | postgresql-$v-istore |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| el8.aarch64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| el9.x86_64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| el9.aarch64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| el10.x86_64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| el10.aarch64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| d12.x86_64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| d12.aarch64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| d13.x86_64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| d13.aarch64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| u22.x86_64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| u22.aarch64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| u24.x86_64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| u24.aarch64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| u26.x86_64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
| u26.aarch64 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 | PIGSTY 0.1.12 |
Source
github.com/adjust/istore
istore-0.1.12.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
istore provides compact integer-key maps for PostgreSQL. The istore type stores integer values, while bigistore stores bigint values; both are useful for sparse counters, distributions, and analytical aggregates keyed by integer identifiers.
Core Workflow
Text input resembles hstore, and array constructors can aggregate repeated keys:
Key lookup uses ->; ?, ?&, and ?| test key presence. || concatenates stores, while arithmetic operators combine matching keys. The istore_key_ops GIN operator class accelerates key-existence predicates.
Important Objects and Caveats
Constructors and transforms include istore(...), bigistore(...), akeys, avals, each, slice, compact, fill_gaps, accumulate, clamp, and delete helpers. sum_up summarizes values, and aggregate SUM returns bigistore so that totals have a wider value type. Per-key minimum and maximum aggregates are also provided.
The cast from istore to bigistore is implicit; narrowing assignments can overflow. Arithmetic and division still require application-level checks for overflow and zero divisors. Large values can be TOASTed, and GIN indexes add write and maintenance cost, so benchmark the actual distribution and update workload instead of treating upstream examples as performance guarantees.