What is the difference between HNSW and IVFFlat in pgvector?
RAG & Vector DB Interview: pgvector HNSW, IVFFlat, Index Tuning, Postgres RAG
Audio flashcard · 0:28Nortren·
What is the difference between HNSW and IVFFlat in pgvector?
0:28
HNSW is a graph-based index that delivers higher recall and faster queries than IVFFlat at the cost of higher build time and memory. IVFFlat partitions vectors into lists and searches only the nearest lists, with faster build time but lower recall and slower queries at the same recall target. HNSW is the recommended default since pgvector 0.5.0 for almost all workloads. IVFFlat remains useful when build time matters more than query speed or when memory is extremely constrained, since it uses less memory than HNSW.
github.com