A PostgreSQL extension that provides a high-performance approximate nearest neighbor index called PRISM, designed to outperform pgvector's IVFFlat and HNSW for both query speed and index building. It is released as ALPHA for testing and warns that upgrades between prereleases may require dropping and recreating the extension and indexes. On large-scale benchmarks (100M+ vectors) PRISM claims faster queries at equivalent recall than graph-based HNSW while using a quarter of the memory. Key capabilities include RaBitQ quantization with theoretical error bounds for two-stage filtering, SIMD-optimized distance computations (AVX2/AVX512/NEON), hierarchical routing, dynamic updates with in-place posting-list splits via prism_rebalance, and tight integration with PostgreSQL buffer cache for in-memory centroid-tree traversal.
PRISM stores vectors in posting lists laid out for SIMD, routes queries through a centroid tree to find candidate clusters, applies RaBitQ estimate+error-bound filtering before full-precision reranking, and returns k nearest neighbors. It supports native vec32/vec16 column types or indexing existing pgvector vector/halfvec columns without rewriting data. Tuning exposes parameters like prism.nprobe; maintenance requires occasional rebalancing of oversized posting lists. Building requires PostgreSQL 18+, a C11 compiler (GCC/Clang), and Meson; optional CBLAS speeds RaBitQ encoding. Documentation covers tuning, maintenance, architecture, SIMD options, and development.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.