pg_lion_vector
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 | - |
pgvector >= 0.7.
Version
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| el8.aarch64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| el9.x86_64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| el9.aarch64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| el10.x86_64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| el10.aarch64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| d12.x86_64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| d12.aarch64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| d13.x86_64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| d13.aarch64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| u22.x86_64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| u22.aarch64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| u24.x86_64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| u24.aarch64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| u26.x86_64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | N/A | N/A |
| u26.aarch64 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | PIGSTY 0.3.0 | 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_vector 0.3.0 adds the lionvec nearest-neighbor access method for pgvector vector and halfvec values. It uses the parent pg_lion library and requires pgvector 0.7 or later.
Core Workflow
Create the parent and vector extensions first. A separate lion index can filter candidates before distance ranking.
Upstream recommends COST 100 for the distance function used by the chosen operator class so the planner can compare scan and sort costs. This setting is not preserved by pg_dump and may be reset by an update of vector.
Operator Classes and Tuning
| Type | L2 (<->) | Negative inner product (<#>) | Cosine (<=>) |
|---|---|---|---|
vector | vector_l2_ops (default) | vector_ip_ops | vector_cosine_ops |
halfvec | halfvec_l2_ops (default) | halfvec_ip_ops | halfvec_cosine_ops |
partitions controls the index build’s clustering; maintenance_work_mem must hold an adequate sample. pg_lion.vector_margin and pg_lion.vector_patience control approximate search. Small candidate sets under a supported lion filter can use exact scoring. pg_lion.vector_postfilter controls predicates the lion indexes cannot answer; review the reference before changing it.
Operational Boundaries
Requires PostgreSQL 16 or later and superuser installation. Only one vector or halfvec column, up to 8128 dimensions, is supported; this is generally approximate search. A filter does not turn every query into exact nearest-neighbor search. Heavy churn may require occasional REINDEX. Parent custom-WAL indexes retain their preload requirement. Keep parent and companion files at the same version.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)