For most production vector search workloads, the index choice reduces to one architectural fork: HNSW, a multi-layer proximity graph that delivers extremely fast, high-recall queries but must live largely in memory, or IVF-Flat and its quantized IVF-PQ variant, which partition vector space into Voronoi cells and trade some recall and speed for dramatically lower memory pressure. Milvus engineering documentation frames the boundary plainly: HNSW suits workloads with sufficient memory, low filtering ratios, and a demand for roughly 98%+ recall, while IVF fits memory-constrained deployments where queries carry filtering conditions. This guide maps those mechanics to operational constraints—RAM ceilings, metadata selectivity, and write frequency—so architects can pick an index before an outage forces the decision.

Architectural Foundations: Graphs vs. Voronoi Partitions

HNSW organizes vectors into a hierarchical navigable small-world graph: upper layers hold sparse long-range links for coarse navigation, and each descent funnels the search toward dense lower layers where candidate neighbors are evaluated. Traversal is tunable through three knobs—the connectivity degree M, the build-time candidate list efConstruction, and the query-time search width efSearch—which together govern the recall-latency-build-time triangle. Because navigation requires hopping between arbitrary nodes, the structure is inherently an in-memory index, as Oracle's vector search documentation notes when contrasting it with storage-based alternatives.

IVF takes the opposite approach. A training phase—typically k-means clustering—partitions the dataset into nlist Voronoi cells, each represented by a centroid, the average vector of that partition. At query time the system assigns the query to its nearest centroids and scans only the top nprobe cells with exact distance computation, as documented in Cisco's internal Milvus-based evaluation environment. This is a storage-based index: Oracle's documentation emphasizes that an IVF index "is not constrained by the amount of memory available in the vector pool like an HNSW vector index is," making it viable for datasets that exceed RAM.

IVF-PQ adds product quantization on top, compressing vectors within cells for further memory savings at a recall cost. ScaNN belongs to this same partition-and-quantization family, but granular latency and memory benchmarks for it are not established here, so the comparison below stays with HNSW and the IVF variants.