MemotivaRAG & Vector DB Interview: HNSW, IVF, Product Quantization, ANN Search Explained

What do the HNSW parameters M, ef_construction, and ef_search control?

RAG & Vector DB Interview: HNSW, IVF, Product Quantization, ANN Search Explained

Audio flashcard · 0:29

Nortren·

What do the HNSW parameters M, ef_construction, and ef_search control?

0:29

M controls the maximum number of connections per node, typically 16 to 64, where higher M improves recall but increases memory and index build time. ef_construction controls how many candidate neighbors are considered when building each node's connections, with higher values producing a better graph at the cost of longer indexing. ef_search is the query-time parameter that sets how many candidates the search keeps in its priority queue, directly trading latency for recall. You can tune ef_search per query without rebuilding the index.
github.com