pg_dann
pg_dann · Disk-oriented IVF approximate vector indexes with SQ8 or RaBitQ quantization.
Overview
PostgreSQL · 16
| Relationships | |
|---|---|
| Requires | vector |
Usage
Sources:
pg_dann 0.1.0 is an experimental disk-oriented approximate vector index using IVF lists and SQ8 or RaBitQ quantization. It depends on vector. The reviewed source was exercised on PostgreSQL 16; wider compatibility is not established here.
Core Workflow
Install with a superuser after installing the dependency. No preload is required.
For useful training, build indexes on representative data. dann_l2_ops, dann_ip_ops and dann_cosine_ops correspond to L2, inner product and cosine operators respectively; the query operator must match the chosen operator class.
Tuning and Inspection
dann.probes controls the lists searched. dann.rerank_factor and dann.enable_rerank control candidate reranking, while dann.max_latency_ms sets a latency budget. Index options include nlist and quantizer; automatic quantization chooses according to dimension count. dann_scan_stats() and dann_list_stats() expose scan and list information.
Reranking uses full-precision candidate vectors, but cannot recover neighbors never selected as candidates. Measure recall as well as latency for your own data. Non-finite vector values are rejected.
Maintenance Boundary
Inserts are serialized through the metapage in this revision. Parallel scans and builds are not implemented. Vacuum removes dead entries but does not reclaim empty index pages; rebuilding may be needed to recover space. Treat this as a prototype and verify recovery and update behavior before relying on it.