roaringbitmap
pg_roaringbitmap : support for Roaring Bitmaps
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 3630 | roaringbitmap | pg_roaringbitmap | 1.2.0 |
TYPE | Apache-2.0 | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| Need By | pgfaceting |
| See Also | hll rum pgfaceting pg_search bloom pg_textsearch pg_bestmatch vchord_bm25 pg_fts |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG | 1.2.0 |
18 17 16 15 14 | pg_roaringbitmap |
- |
| RPM | PGDG | 1.2.0 |
18 17 16 15 14 | pg_roaringbitmap_$v |
- |
| DEB | PGDG | 1.2.0 |
18 17 16 15 14 | postgresql-$v-roaringbitmap |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el8.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el9.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el9.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el10.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el10.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| d12.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| d12.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| d13.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| d13.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u22.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u22.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u24.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u24.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u26.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u26.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
Source
github.com/ChenHuajun/pg_roaringbitmap
pg_roaringbitmap-1.2.0.tar.gz
Install
Make sure PGDG repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
pg_roaringbitmap installs the PostgreSQL extension roaringbitmap, which provides compressed bitmap types and set-operation functions backed by Roaring Bitmaps. Use it for compact integer-set storage, fast unions/intersections, cohort filters, faceting, and bitmap aggregation.
v1.2.0 adds rb_runoptimize() / rb64_runoptimize() to shrink bitmap binary size, preserves the legacy rb_exsit spelling for backward compatibility, adds PostgreSQL 19 compatibility, and validates untrusted bitmap input in receive functions.
Create the Extension
roaringbitmap.output_format can be bytea or array. The default output format is bytea, which is better for large bitmaps; array is easier to read interactively.
Data Types
roaringbitmapstores unsigned 32-bit integer sets over the logical range[0, 4294967296).roaringbitmap64stores unsigned 64-bit integer sets and uses therb64_function family.
Build and Convert
For 64-bit values, use rb64_build(), rb64_build_agg(), rb64_to_array(), and rb64_iterate().
Set Operations
Containment and overlap operators are available:
Cardinality and Range Helpers
The 64-bit range helpers use the rb64_ prefix. Since v1.1.0, range_end = 0 means unlimited for several rb64_ range/select functions.
Aggregate Functions
Optimize Serialized Size
rb_runoptimize() and rb64_runoptimize() can reduce serialized bitmap size for suitable data distributions. Measure before using them in hot write paths.
Caveats
- Pigsty uses extension file name
roaringbitmap.md; the upstream package name ispg_roaringbitmap. - Source builds require PostgreSQL headers and CRoaring dependencies. The README notes regression testing before release covers PostgreSQL 13 and above.
Makefile_nativecan compile with SIMD instructions and may be faster on matching CPUs, but binaries built that way can crash withSIGILLon machines without the required CPU features.- Use
byteaoutput for large bitmaps andarrayoutput for human inspection.