In 2019, five researchers working out of Microsoft Research India (Suhas Jayaram Subramanya, Devvrit, Rohan Kadekodi, Ravishankar Krishnaswamy, and Harsha Vardhan Simhadri) overturned the rule that billion-scale vector search belonged only in RAM or on GPUs. DiskANN indexes and searches one billion 128-dimensional vectors on one 64 GB workstation with commodity NVMe SSDs, sustaining over 5,000 queries per second at under 3 ms mean latency and above 95% 1-recall@1.
At the time, FAISS explicitly warned against searching from SSDs. Production retrieval teams either paid for multi-terabyte DRAM clusters or accepted steep recall ceilings from lossy quantization. DiskANN broke that tradeoff by co-designing its graph and 4 KB disk layout around SSD physics, establishing the blueprint behind modern disk-backed vector indexes.
- Single-node billion-point scale: on SIFT1B (1B 128-dimensional vectors, 16 cores, 64 GB RAM), DiskANN serves over 5,000 QPS under 3 ms mean latency above 95% 1-recall@1 (peaking at 98.68% under 5 ms on a one-shot build).
- Beating compressed RAM baselines: at the same 64 GB memory budget on SIFT1B,
IVFOADC+G+P-16plateaus at 37.04% 1-recall@1 andIVFOADC+G+P-32stalls at 62.74%, whereas DiskANN saturates at 100% recall. - 2x to 3x fewer disk hops: Vamana’s multiplicative pruning rule (
alpha > 1) shrinks search depth to 3 to 4 hops on SIFT1M, versus 8.5 to 11 hops for NSG and HNSW. - 5x to 10x higher density per node: storing the graph and full vectors on SSD while pinning only Product Quantization (PQ) codes and top BFS levels in DRAM replaces entire server clusters.
Why naive disk and compressed indexes break
Before DiskANN, billion-scale vector search forced an ugly choice between multi-node RAM cost and poor top-1 precision.
In-memory graphs like HNSW and NSG store full vectors alongside graph edges in DRAM. An NSG index at degree 50 over 100 million 128-dimensional float vectors already takes roughly 75 GB. To serve two billion vectors, Alibaba’s Taobao sharded them across 32 separate machines, fanning every query out to all 32 nodes to reach 0.98 100-recall@100 in 5 ms. Moving those graphs straight onto SSD collapses throughput: retail NVMe drives take a few hundred microseconds per random read (around 300K to 500K IOPS total), and standard graphs issue hundreds of sequential round trips per query.
Compressed inverted indexes fit one billion vectors inside 64 GB RAM using k-means clustering plus Product Quantization or Optimized PQ (OPQ). While FAISS and IVFOADC+G+P answer queries under 5 ms, lossy codes distort fine neighborhood distances. On SIFT1B, IVFOADC+G+P plateaus at 37.04% 1-recall@1 with 16-byte codes and 62.74% with 32-byte codes, often masking weak top-1 accuracy behind looser 1-recall@100 numbers.
An earlier disk hybrid, Zoom, routed queries through an HNSW layer over k-means centroids, shortlisted candidates with PQ, and fetched K' full vectors from SSD to re-rank. The paper identifies two flaws: clustering 200,000 centroids (already needed at 10 million points) scales poorly to a billion vectors, and firing nearly 100 simultaneous random SSD reads in one burst at the end of every query clogs disk queues and spikes tail latency.
Vamana: shrinking graph diameter for SSD hops
To keep SSD queries under 5 ms, traversal cannot spend dozens of serial hops crossing the corpus. DiskANN introduces Vamana, a directed graph algorithm built to trade edge degree directly for smaller diameter.
HNSW and NSG approximate the Sparse Neighborhood Graph (SNG) rule, pruning candidate p' whenever an existing neighbor p* satisfies d(p*, p') <= d(p, p'). That guarantees distance to the query strictly decreases each step, yet offers no bound on path length: on a 1D line, SNG degenerates into an O(n)-diameter chain linking only immediate neighbors. On SIFT1M, raising max degree from 64 to 512 barely budges the hop count at 98% 5-recall@5: HNSW stays near 11 hops and NSG stays around 8.5 to 9 hops.
Vamana fixes this in RobustPrune by multiplying the pruning threshold by alpha >= 1: candidate p' is pruned only if alpha * d(p*, p') <= d(p, p'). With alpha = 2, distances along a search route must shrink geometrically rather than linearly, forcing long-range shortcuts wherever out-degree R has room. Raising R from 64 to 512 on SIFT1M drops Vamana from roughly 7 hops down to under 3 hops, 2x to 3x fewer SSD round trips than NSG or HNSW.
Three implementation choices make Vamana practical at billion scale:
- Two-pass build from a random graph: starting from a random
R-regular directed graph anchored at medoids, Vamana sweeps all points twice in random order. Pass 1 usesalpha = 1to form local paths cheaply without degree blowup; pass 2 usesalpha = 2to add long shortcuts. Random initialization beats HNSW’s empty start and avoids NSG’s heavy k-NN pre-build (DEEP1M indexing takes 149s for Vamana versus 219s for HNSW and 480s for NSG with EFANNA). - Pruning the entire visited path: during indexing,
RobustPruneinspects the full visited vertex setVfromGreedySearchrather than only the finalLcandidates as in HNSW, injecting long edges on one flat graph without hierarchical layers. Reverse edges(p', p)are also added and pruned when degrees exceedR. - Overlapping shards for 64 GB builds: building one global SIFT1B graph (
R = 128, L = 125, alpha = 2) took ~2 days on a 1,792 GB VM (M64-32ms) using ~1,100 GB peak RAM (average degree 113.9). On the 64 GBz840workstation, DiskANN clusters points intok = 40k-means partitions, sends each vector to itsl = 2closest centroids (~5% of data per shard), indexes each shard (R = 64) in RAM over ~5 days, and unions all edges into one 348 GB SSD graph (average degree 92.1). Overlap bridges shard boundaries with at most 20% extra query latency over the one-shot graph.
Keeping SSD round trips under five
Even a low-diameter graph stalls on flash storage if every hop waits on serial disk I/O or PQ errors spoil top-1 ranking. DiskANN solves both problems with three systems techniques.
First, fixed-stride 4 KB blocks remove offset tables and yield free exact re-ranking. On SSD, each node i stores its full-precision vector x_i immediately followed by up to R zero-padded neighbor IDs. Uniform record sizes mean byte offsets are simple arithmetic, requiring zero offset metadata in DRAM. Because an NVMe drive reads a 4 KB-aligned page in the same time as 512 bytes, a 128-dimensional vector plus 4 * 128 bytes of degree-128 edges shares one 4 KB sector. Every neighbor-list read automatically delivers x_i into memory at zero extra disk cost, letting DiskANN re-rank visited nodes by exact Euclidean distance and erase PQ’s recall cap.
Second, narrow BeamSearch pipelines reads without backlogging NVMe queues. Instead of fetching W = 1 vertex per round trip, BeamSearch issues W concurrent random reads (W = 2, 4, or 8) for the closest unvisited candidates. Small read batches return in nearly the time of one sector while keeping SSD load at 30% to 40% (and threads at 40% to 50% I/O wait). Setting W = 16 or higher queues requests past 1 ms per read and wastes compute.
Third, BFS hub caching absorbs early traversal in DRAM. Pinning all vertices within C = 3 or 4 BFS hops of medoid s (or hot query-log hubs) avoids repeated disk contention at the root of every query.
Tracing the design knobs on billion-point search
Use the explorer below to inspect how each of DiskANN’s five tuning levers changes hop count, memory footprint, and recall on SIFT1B and SIFT1M.
Select a component (or use Left and Right arrow keys) to inspect what breaks with the naive setting, DiskANN's mechanism, and the measured impact in the paper.
Multiplicative pruning (alpha > 1)
Vamana graphScaling the RNG pruning check by alpha = 2 turns spare edge budget into long-range shortcuts that slash SSD hop depth.
- Why alpha = 1 breaks
- Standard SNG/RNG pruning in HNSW and NSG can form O(n)-diameter chains and plateaus at ~8.5 to 11 hops on SIFT1M even at degree 512.
- DiskANN's mechanism
- Two-pass Vamana runs pass 1 at alpha = 1 for fast connectivity, then pass 2 at alpha = 2 pruning p' whenever 2 * d(p*, p') <= d(p, p').
- Measured evidence
- At 98% 5-recall@5 on SIFT1M (W = 4), Vamana drops from ~7 hops at R = 64 to under 3 hops at R = 512, 2x to 3x fewer hops than HNSW or NSG.
- In-memory bonus
- Even without an SSD, Vamana beats HNSW and NSG on 960-dim GIST1M and builds DEEP1M in 149s vs 219s (HNSW) and 480s (NSG).
Parallel frontier expansion (BeamSearch)
SSD I/OBatching W = 2 to 8 concurrent SSD reads per hop slashes sequential round trips while avoiding SSD queue saturation.
- Why W = 1 or W >= 16 breaks
- W = 1 serializes every hop into its own disk round trip; W >= 16 saturates SSD request queues above 1 ms per read and wastes distance compute.
- DiskANN's mechanism
- Issue async reads for the W closest unvisited candidates in L minus V simultaneously, updating the beam with all returned neighbors together.
- Measured evidence
- Small widths (W = 2, 4, 8) keep SSD load at 30% to 40% and thread I/O time at 40% to 50%, delivering over 5,000 QPS under 3 ms on 16 cores.
- Engineering takeaway
- Throughput peaks require tuning concurrency below the NVMe queue backlog cliff rather than saturating peak 500K IOPS.
Overlapping k-means sharding and graph union
Index buildAssigning each vector to its l = 2 nearest centroids lets a 64 GB workstation build a unified billion-point graph.
- Why disjoint or one-shot breaks
- One-shot SIFT1B indexing needs ~1,100 GB RAM; disjoint k-means shards force every query to scatter across multiple sub-indexes at search time.
- DiskANN's mechanism
- Cluster 1B points into k = 40 shards, replicate each point to its l = 2 nearest shards (~5% per shard), index each in RAM, and union all edge sets.
- Measured evidence
- Merged SIFT1B index (348 GB on SSD, avg degree 92.1) builds in ~5 days under 64 GB RAM with at most 20% extra latency over the 1,100 GB one-shot graph.
- Why union works
- Shared boundary points stitch cluster graphs together so GreedySearch crosses partition borders smoothly on a single unified SSD graph.
In-memory PQ + zero-extra-read re-ranking
Memory layoutPQ codes steer graph traversal in DRAM while 4 KB co-located SSD reads bring back exact vectors for free.
- Why PQ-only or Zoom breaks
- PQ-only search plateaus at 37.04% (16B) or 62.74% (32B) 1-recall@1 on SIFT1B; Zoom fetches ~100 full vectors in one trailing SSD burst.
- DiskANN's mechanism
- Store ~32B PQ codes in RAM for candidate ordering and pack [full vector x_i | padded R neighbor IDs] into one fixed-stride 4 KB SSD page.
- Measured evidence
- Piggybacking full vectors on neighbor reads eliminates the 62.74% OPQ ceiling, reaching 95%+ 1-recall@1 under 3.5 ms and up to 100% recall.
- Memory savings
- Fixed byte stride removes any need for an in-memory node-offset table, reserving virtually all 64 GB RAM for PQ codes and cached hubs.
Caching C = 3 to 4 hops around the medoid
DRAM cachePinning the graph's early routing neighborhood in DRAM avoids hot-spot disk reads on every single query.
- Why cold traversal breaks
- Every query starts at the medoid s and traverses the same high-degree hub nodes first, wasting multiple SSD round trips on shared prefixes.
- DiskANN's mechanism
- Pre-load adjacency lists and full coordinates for all vertices within C = 3 or 4 BFS hops of medoid s (or top query-log nodes) into DRAM.
- Measured evidence
- With 3 BFS levels cached in DRAM, Vamana converges in ~3 to 4 remaining SSD hops on SIFT1M; larger C grows exponentially and blows RAM budgets.
- Operational rule
- Cap C tightly around 3 or 4 hops (or use workload-driven hot-node pinning) so cached vertices stay a small fraction of 64 GB RAM.
Without clicking through the tabs, DiskANN’s performance comes from five coupled constraints:
- Multiplicative pruning (
alpha = 2): buys long-range shortcuts from degreeR, cutting hop count 2x to 3x below HNSW and NSG. - Narrow beam search (
W = 2to8): hides random-read latency via parallel I/O without queueing NVMe drives past 1 ms. - Overlapping sharding (
k = 40, l = 2): builds a 348 GB billion-point graph inside 64 GB RAM with at most 20% latency penalty. - Co-located 4 KB blocks: loads exact vectors alongside neighbor lists for free, removing PQ’s 37% to 63% recall ceiling.
- Shallow BFS DRAM cache (
C = 3or4): keeps shared medoid prefixes in memory so SSD reads start near the target region.
Caveats and what came after DiskANN
Three practical boundaries qualify the 2019 paper’s results.
First, the index is static and read-only. Two-pass Vamana construction and fixed-stride SSD blocks do not handle streaming inserts or deletes, and dropping vertices in place breaks routing bridges for distant nodes. Subsequent work in FreshDiskANN solved live updates by pairing a small mutable RAM index with background SSD consolidation.
Second, the 2019 graph supports unfiltered Euclidean search only. Applying selective metadata filters post-search wipes out candidates, while filtering mid-traversal disconnects graph paths. Filtered-DiskANN later extended Vamana’s pruning criterion to preserve label-connected routes.
Third, build time and vector width shift the hardware equation. Merged 1B indexing still took 5 days on a 16-core z840, and SIFT1B (128 uint8s) plus DEEP1B (96 floats) are compact compared to 1,536-dimensional or 3,072-dimensional LLM embeddings, which occupy 6 KB to 12 KB per vector and span multiple 4 KB SSD pages unless compressed further.
For builders running vector retrieval today, DiskANN’s lesson endures: keep hot routing prefixes and compact PQ codes in RAM, store exact vectors next to adjacency lists on NVMe, and size your graph diameter for flash round trips rather than buying terabytes of DRAM.


