pg_vectorsearch
pg_vectorsearch · Approximate vector search with PRISM indexes and RaBitQ quantization
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 1990 | pg_vectorsearch | pg_vectorsearch | 0.2.0 | RAG | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| See Also | vector vectorscale |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 0.2.0 | N/A | N/A | N/A |
| el8.aarch64 | N/A | PIGSTY 0.2.0 | N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 0.2.0 | PIGSTY 0.2.0 | N/A | N/A | N/A |
Source
github.com/timescale/pg_vectorsearch
pg_vectorsearch-0.2.0.tar.gz
meson-0.63.3.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
- README.md
- sql/pg_vectorsearch.sql
- docs/maintenance.md
- docs/tuning.md
- CHANGELOG.md
- VERSION
- meson.build
- pg_vectorsearch.control.in
pg_vectorsearch 0.2.0 is an alpha extension for approximate nearest-neighbor search with the PRISM index. It supports PostgreSQL 18 and 19, native vec32 / vec16 types and optional pgvector interoperability. It is intended for testing, with evolving behavior and maintenance requirements.
Core Workflow
Operational Boundaries
Install as a superuser; no preload is required and the extension is not relocatable. The prism access method has vec32_l2_ops, vec32_ip_ops, vec32_cosine_ops and corresponding vec16 operator classes; <->, <#> and <=> express L2, negative inner product and cosine distance. prism.nprobe trades recall for query work; zero selects automatic tuning, not exact recall.
Load representative data before building the index. L2 and cosine indexes support up to 8192 dimensions: any dimension through 1968, then a power of two times an odd factor at most eight. Inner-product indexes remain limited to 1968 for vec32 and 3584 for vec16. Expression and unlogged indexes are unsupported. Keep prism.leaf_refine_threshold at zero. Filtering can return fewer rows than LIMIT, and candidate buffers bounded by work_mem can truncate large or unbounded results. Measure against an exact baseline.
Inspect prism_index_settings and follow the maintenance guide for churn. prism_rebalance supports only flat RaBitQ centroid-page indexes with centroid_fastscan off, not the default multilevel format. DELETE leaves tombstones, and retired pages are reclaimed only by REINDEX. There is no in-place upgrade from the earlier release candidates.
Upgrade to 0.2.0
Install matching files, start a fresh session that has not loaded the old library, update the SQL extension and rebuild every PRISM index:
Old index format 0x06 is rejected by the 0x07 reader. The two library versions cannot share one session. vec32_norm is renamed to l2_norm; the vec16 overload of vec32_dims becomes vec16_dims, while vector_dims provides the pgvector-compatible interface. Update direct callers of renamed functions; dependent views retain function OIDs.
posting_reference_format defaults to float16. A reference element beyond ±65504 causes a build or split error; use float32 when needed. The vec16 type now rejects out-of-range input. Existing filter, buffer-size and maintenance limits still apply.