vchord
vchord : Vector database plugin for Postgres, written in Rust
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 1810 | vchord | vchord | 1.3.0 |
RAG | AGPL-3.0-only | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-r | No | Yes | Yes | Yes | yes | no |
| Relationships | |
|---|---|
| Requires | vector |
| See Also | vector vectorscale pgcontext vectorize pg_rrf pg_search vchord_bm25 pg_bestmatch pgml pg4ml |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el8.aarch64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el9.x86_64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el9.aarch64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el10.x86_64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el10.aarch64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| d12.x86_64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| d12.aarch64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| d13.x86_64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| d13.aarch64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u22.x86_64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u22.aarch64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u24.x86_64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u24.aarch64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u26.x86_64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u26.aarch64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
Source
vchord.pgsty.com/docs/vchord/
vchord-1.3.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
Sources:
- Installation and upgrades
- Partitioned vector indexes
- Graph indexes and result ordering
- Per-index search defaults
- Quantized vector types
- Recall evaluation
- 1.2.0 release notes
- 1.2.0 control file
vchord 1.2.0 provides approximate vector search on PostgreSQL 14–18. It uses pgvector’s types and adds the partitioned vchordrq index and the disk graph vchordg index. It requires the vector extension, shared preloading, and superuser privileges to install. Graph indexing is documented as a preview feature.
Enable and Search
Add the library to the existing preload list and restart PostgreSQL:
Small datasets can start with an unpartitioned index. For larger datasets, choose the partition hierarchy through TOML build.internal.lists, then set vchordrq.probes to the number of partitions to search at each level. More probes trade query work for recall; the probe list must match the hierarchy. The graph alternative uses the same column and distance operator classes:
Use the graph definition as an alternative to the partitioned index above. The recall example below assumes only the partitioned index exists; inspect the query plan when comparing index methods.
Types, Operators, and Tuning
| Object | Purpose |
|---|---|
vector_l2_ops, <-> |
Euclidean distance, ordered ascending. |
vector_ip_ops, <#> |
Negative inner product, ordered ascending. |
vector_cosine_ops, <=> |
Cosine distance, ordered ascending. |
halfvec |
Half-precision vectors, with corresponding halfvec_*_ops classes. |
rabitq4, rabitq8 |
Quantized vector storage; conversion loses precision. |
sphere, <<->>, <<#>>, <<=>> |
Distance-radius predicates for L2, inner product, and cosine search. |
vchordrq.epsilon |
Reranking tradeoff; default 2.5 in 1.2.0, previously 1.9. |
vchordg.ef_search |
Graph search breadth; default 64. |
vchordrq_prewarm, vchordg_prewarm |
Load hot index pages; require table ownership or table-level SELECT. |
Sphere radii use the distance operator’s units. PostgreSQL rechecks graph sphere predicates, but approximate search can still miss matching rows. Dequantization cannot recover the original vector exactly.
Per-index probes, epsilon, and ef_search options supply search defaults. Explicit GUC settings, including database or server settings, override them. Resetting a session setting restores its configured default, which can still override the index.
Ordering and Recall
Graph scans can discover closer rows after returning earlier candidates; nearly equal half-precision distances can also appear out of order. Increasing the search breadth reduces some ordering errors but does not guarantee strict ordering. Materialize a larger candidate set and sort it explicitly when ordering matters:
This sorts the retrieved candidates; recall still depends on the candidate count and search parameters. For partitioned indexes, compare approximate results with an exact baseline:
The query must return ctid; keep sequential scans enabled for the exact pass. Multi-vector MaxSim queries using @# require exact_search => true for recall evaluation.
Maintenance and Upgrade
Keep normal vacuuming enabled: graph searches exclude deleted vertices after VACUUM, and index maintenance updates tuple/page statistics. ANALYZE alone does not rebuild or compact the index.
Install matching 1.2.0 library and SQL files, restart PostgreSQL to load the new library, then update each database as the extension owner or an administrator:
The release provides upgrade paths from 0.2.0 through 1.1.1 without reindexing. Recheck representative rankings after upgrading: 1.2.0 fixes MaxSim candidate estimates, graph sphere filters, deleted-vertex visibility, and quantization edge cases, and raises the default reranking budget. The extension is relocatable; include its chosen schema in the search path or qualify its objects.