pg_lion
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_lion | 0.3.0 | FEAT | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2715 | pg_lion | No | Yes | No | Yes | No | Yes | - |
| 2716 | pg_lion_citext | No | No | No | Yes | No | Yes | - |
| 2717 | pg_lion_vector | No | Yes | No | Yes | No | Yes | - |
| Related | |
|---|---|
| Depended By | pg_lion_citext pg_lion_vector |
Custom WAL requires preload.
Version
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.3.0 el8.x86_64.pg18 : pg_lion_18 pg_lion_18-0.3.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.3.0 el8.x86_64.pg17 : pg_lion_17 pg_lion_17-0.3.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.3.0 el8.x86_64.pg16 : pg_lion_16 pg_lion_16-0.3.0-1PGSTY.el8.x86_64.rpm
| N/A | N/A |
| el8.aarch64 | PIGSTY 0.3.0 el8.aarch64.pg18 : pg_lion_18 pg_lion_18-0.3.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.3.0 el8.aarch64.pg17 : pg_lion_17 pg_lion_17-0.3.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.3.0 el8.aarch64.pg16 : pg_lion_16 pg_lion_16-0.3.0-1PGSTY.el8.aarch64.rpm
| N/A | N/A |
| el9.x86_64 | PIGSTY 0.3.0 el9.x86_64.pg18 : pg_lion_18 pg_lion_18-0.3.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.3.0 el9.x86_64.pg17 : pg_lion_17 pg_lion_17-0.3.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.3.0 el9.x86_64.pg16 : pg_lion_16 pg_lion_16-0.3.0-1PGSTY.el9.x86_64.rpm
| N/A | N/A |
| el9.aarch64 | PIGSTY 0.3.0 el9.aarch64.pg18 : pg_lion_18 pg_lion_18-0.3.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.3.0 el9.aarch64.pg17 : pg_lion_17 pg_lion_17-0.3.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.3.0 el9.aarch64.pg16 : pg_lion_16 pg_lion_16-0.3.0-1PGSTY.el9.aarch64.rpm
| N/A | N/A |
| el10.x86_64 | PIGSTY 0.3.0 el10.x86_64.pg18 : pg_lion_18 pg_lion_18-0.3.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.3.0 el10.x86_64.pg17 : pg_lion_17 pg_lion_17-0.3.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.3.0 el10.x86_64.pg16 : pg_lion_16 pg_lion_16-0.3.0-1PGSTY.el10.x86_64.rpm
| N/A | N/A |
| el10.aarch64 | PIGSTY 0.3.0 el10.aarch64.pg18 : pg_lion_18 pg_lion_18-0.3.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.3.0 el10.aarch64.pg17 : pg_lion_17 pg_lion_17-0.3.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.3.0 el10.aarch64.pg16 : pg_lion_16 pg_lion_16-0.3.0-1PGSTY.el10.aarch64.rpm
| N/A | N/A |
| d12.x86_64 | PIGSTY 0.3.0 d12.x86_64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.3.0 d12.x86_64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.3.0 d12.x86_64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~bookworm_amd64.deb
| N/A | N/A |
| d12.aarch64 | PIGSTY 0.3.0 d12.aarch64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.3.0 d12.aarch64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.3.0 d12.aarch64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~bookworm_arm64.deb
| N/A | N/A |
| d13.x86_64 | PIGSTY 0.3.0 d13.x86_64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.3.0 d13.x86_64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~trixie_amd64.deb
| PIGSTY 0.3.0 d13.x86_64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~trixie_amd64.deb
| N/A | N/A |
| d13.aarch64 | PIGSTY 0.3.0 d13.aarch64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.3.0 d13.aarch64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~trixie_arm64.deb
| PIGSTY 0.3.0 d13.aarch64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~trixie_arm64.deb
| N/A | N/A |
| u22.x86_64 | PIGSTY 0.3.0 u22.x86_64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.3.0 u22.x86_64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~jammy_amd64.deb
| PIGSTY 0.3.0 u22.x86_64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~jammy_amd64.deb
| N/A | N/A |
| u22.aarch64 | PIGSTY 0.3.0 u22.aarch64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.3.0 u22.aarch64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~jammy_arm64.deb
| PIGSTY 0.3.0 u22.aarch64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~jammy_arm64.deb
| N/A | N/A |
| u24.x86_64 | PIGSTY 0.3.0 u24.x86_64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.3.0 u24.x86_64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~noble_amd64.deb
| PIGSTY 0.3.0 u24.x86_64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~noble_amd64.deb
| N/A | N/A |
| u24.aarch64 | PIGSTY 0.3.0 u24.aarch64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.3.0 u24.aarch64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~noble_arm64.deb
| PIGSTY 0.3.0 u24.aarch64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~noble_arm64.deb
| N/A | N/A |
| u26.x86_64 | PIGSTY 0.3.0 u26.x86_64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.3.0 u26.x86_64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~resolute_amd64.deb
| PIGSTY 0.3.0 u26.x86_64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~resolute_amd64.deb
| N/A | N/A |
| u26.aarch64 | PIGSTY 0.3.0 u26.aarch64.pg18 : postgresql-18-pg-lion postgresql-18-pg-lion_0.3.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.3.0 u26.aarch64.pg17 : postgresql-17-pg-lion postgresql-17-pg-lion_0.3.0-1PGSTY~resolute_arm64.deb
| PIGSTY 0.3.0 u26.aarch64.pg16 : postgresql-16-pg-lion postgresql-16-pg-lion_0.3.0-1PGSTY~resolute_arm64.deb
| N/A | N/A |
Build
You can build the RPM / DEB packages for pg_lion using pig build:
Install
You can install pg_lion 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:
pg_lion 0.3.0 adds roaring bitmap inverted indexes for filtering, counts and grouped aggregates on PostgreSQL 16 and later. It works on heap tables and uses ordinary PostgreSQL operators; it does not require preloading for its default generic WAL mode.
Core Workflow
Create lion indexes on the columns used by filters and groups. Vacuumed, all-visible pages let counts avoid heap visits; recently changed pages may need visibility checks in the heap.
Scalar equality, ranges, IN, null tests and combined predicates are supported. lion also indexes arrays, jsonb and tsvector; lion_bm25_score ranks full-text matches. An expression index on a JSON field can support grouping that a default jsonb index cannot.
Options and Diagnostics
| Object | Purpose |
|---|---|
summaries = auto | Pre-merge bitmaps to accelerate ranges with many distinct values. |
slices = on | Store bit slices for filtered aggregates on integer, date and time values; adds write and storage cost. |
lion_index_count(index, key) | Count a key through a named index. |
lion_index_stats(index) | Inspect index statistics; initially granted to pg_stat_scan_tables. |
lion_index_verify(index, true) | Check structure and heap coverage; restricted diagnostic function. |
lion_index_wal_mode(index) | Report generic or rmgr; restricted diagnostic function. |
pg_lion_citext adds the citext operator class. pg_lion_vector adds the lionvec access method and requires pgvector 0.7 or later. Both companions ship with the parent distribution and are enabled separately.
WAL and Operational Boundaries
Creating the extensions requires a superuser. Optional shared_preload_libraries = 'pg_lion' plus a server restart enables the custom WAL resource manager (default ID 170). Indexes built in that mode require the preload for writes and VACUUM until rebuilt; check lion_index_wal_mode before changing the setting.
Keep the library preloaded wherever old custom WAL may still be replayed, including standbys and archive recovery. REINDEX does not rewrite historical WAL. Before removing the preload, rebuild every rmgr index with wal_mode = generic while the library is still preloaded, and account for WAL replay consumers.
There are no unique indexes or INCLUDE columns, and only heap tables are supported. Keep B-tree indexes for uniqueness and ordinary ordered scans. Loading the library installs planner hooks and can affect estimates for other queries. Measure write-heavy workloads before adding indexes or slices.
The on-disk format may change before 1.0; follow release-specific REINDEX requirements. Builds predating 0.3.0 have no extension update path: upstream requires recreating the extensions and their indexes. Version 0.3.0 supplies installation scripts only.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)