vchord
Overview
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 1810 | vchord | No | Yes | Yes | Yes | No | Yes | - |
| Related | vector vector vectorscale pgcontext vectorize pg_rrf pg_search vchord_bm25 pg_bestmatch pgml pg4ml |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.1.1 | 1817161514 | vchord | vector |
| RPM | PIGSTY | 1.1.1 | 1817161514 | vchord_$v | pgvector_$v |
| DEB | PIGSTY | 1.1.1 | 1817161514 | postgresql-$v-vchord | postgresql-$v-pgvector |
Build
You can build the RPM / DEB packages for vchord using pig build:
Install
You can install vchord directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Preload:
Create Extension:
Usage
Sources:
- 1.1.1 README
- Control and dependency
- Preload requirement
- 1.1.1 SQL objects
- Query settings
- 1.1.1 migration
- 1.1.1 release notes
vchord adds approximate vector indexes to PostgreSQL using pgvector’s types. It provides the partition-based vchordrq and graph-based vchordg access methods. The extension requires vector, shared preloading, and superuser privileges to create.
Create and Query an Index
Add the library to the existing preload list, preserving other entries, and restart PostgreSQL:
Use vector_l2_ops with <->, vector_ip_ops with <#>, and vector_cosine_ops with <=>. The inner-product operator returns a negative value for ascending index ordering. The same operator classes can be used with the graph access method; choose one index design for the workload:
Range Queries and Tuning
The extension supplies explicit sphere predicates for range search:
<<->>, <<#>>, and <<=>> are sphere predicates for L2, inner product, and cosine metrics. Probe counts depend on the partition layout; tune them with representative data. The epsilon setting controls the reranking tradeoff. The graph search setting controls its candidate search breadth. Both index methods are approximate: check recall, filters, and query plans before choosing settings.
Quantization in 1.1.1
rabitq8 and rabitq4 store quantized vectors. quantize_to_rabitq8 and quantize_to_rabitq4 accept vector or halfvec. Version 1.1.1 adds dequantize_to_vector and dequantize_to_halfvec overloads for both quantized types:
Quantization loses precision; dequantization returns an approximation. The release also replaces the quantization implementation. Install matching library and SQL files, restart for the preloaded library, then update each database:
The 1.1.0-to-1.1.1 script adds these four conversion overloads and declares no index-format migration. Earlier-version upgrade requirements depend on the starting version. Index construction and prewarming consume resources; schedule them for the dataset size. vchordg_prewarm is the corresponding graph-index helper. The control is relocatable, so qualify extension objects or include their installation schema in the search path when installed outside the usual schema.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)