Back to library

🧭Understand ANN Algorithms: HNSW, IVF, PQ

Stop tuning ef and M by trial and error — see HNSW, IVF, and PQ as physical structures (a multilayer skip graph, a coarse cluster index, and a vector compressor) so you can predict which one fits a 100M-vector workload before you benchmark anything.

Advanced14 drops~2-week path · 5–8 min/daytechnology

Phase 1Why Exact Nearest Neighbor Breaks

See why exact NN dies past 100K vectors

4 drops
  1. Exact nearest neighbor doesn't scale, and that's the whole story

    5 min

    Exact nearest neighbor doesn't scale, and that's the whole story

  2. Recall is a knob, not a guarantee

    6 min

    Recall is a knob, not a guarantee

  3. Graph, cluster, compress — three ways to dodge O(n)

    5 min

    Graph, cluster, compress — three ways to dodge O(n)

  4. The three-axis budget every ANN tuning fight is really about

    6 min

    The three-axis budget every ANN tuning fight is really about

Phase 2Sketching HNSW, IVF, and PQ by Hand

Sketch HNSW, IVF, and PQ by hand

5 drops
  1. HNSW is a skip list pretending to be a graph

    7 min

    HNSW is a skip list pretending to be a graph

  2. Trace a query from top to bottom, by hand

    7 min

    Trace a query from top to bottom, by hand

  3. IVF is just k-means with an inverted file

    6 min

    IVF is just k-means with an inverted file

  4. PQ shrinks vectors 8x with almost no recall loss

    7 min

    PQ shrinks vectors 8x with almost no recall loss

  5. Real systems compose; pure HNSW or pure IVF is a starting point

    7 min

    Real systems compose; pure HNSW or pure IVF is a starting point

Phase 3Choosing Indexes for Real Workloads

Compare recall, RAM, and update cost in real systems

4 drops
  1. Your HNSW recall dropped after a re-shard, and nobody knows why

    7 min

    Your HNSW recall dropped after a re-shard, and nobody knows why

  2. Your CFO wants a 60% cloud spend cut and your 50M-vector HNSW lives in RAM

    8 min

    Your CFO wants a 60% cloud spend cut and your 50M-vector HNSW lives in RAM

  3. Your e-commerce vectors update every minute and your IVF index is drifting

    7 min

    Your e-commerce vectors update every minute and your IVF index is drifting

  4. Your queries are 'find similar items under $50 in stock' and recall just collapsed

    7 min

    Your queries are 'find similar items under $50 in stock' and recall just collapsed

Phase 4Designing for 100M Vectors with Updates

Pick the right index for a 100M-vector workload

1 drop
  1. Pick and defend an ANN design for a 100M-vector workload with updates

    8 min

    Pick and defend an ANN design for a 100M-vector workload with updates

Frequently asked questions

What does 'approximate' actually trade away in ANN search?
This is covered in the “Understand ANN Algorithms: HNSW, IVF, PQ” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
When should I pick HNSW over IVF for a vector database?
This is covered in the “Understand ANN Algorithms: HNSW, IVF, PQ” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
How do ef and M parameters change HNSW recall and latency?
This is covered in the “Understand ANN Algorithms: HNSW, IVF, PQ” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
Why does product quantization barely lose recall while cutting RAM 8x?
This is covered in the “Understand ANN Algorithms: HNSW, IVF, PQ” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
Which ANN index fits a 100M-vector workload with frequent updates?
This is covered in the “Understand ANN Algorithms: HNSW, IVF, PQ” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.