Index Comparison
Compare different vector index algorithms side-by-side
GRAPH
HNSW
Hierarchical Navigable Small World - A graph-based index with multiple layers for efficient approximate nearest neighbor search.
Pros
- + Tunable recall
- + Graph-based candidate search
- + No training required
- + Supports incremental updates
Cons
- - Higher memory usage
- - Build work grows with search breadth
- - Compression depends on implementation
- - Memory grows with graph connectivity
CLUSTER
IVF
Inverted File Index - Partitions vectors into clusters using k-means, then searches only relevant clusters.
Pros
- + Good scalability
- + Stores vectors plus list assignments
- + Can combine with PQ
- + Probe count controls work
Cons
- - Requires training
- - Fixed cluster count
- - Unprobed lists can contain neighbors
- - Needs parameter tuning
Feature Comparison
These scenes show separate synthetic fixtures, not a performance comparison. Open either explorer to measure recall and replay the actual search. PQ and LSH are reference concepts without an interactive implementation here.
| Feature | HNSW | IVF | PQ | LSH |
|---|---|---|---|---|
| Recall @10 | Dataset-dependent | Dataset-dependent | Dataset-dependent | Dataset-dependent |
| Query work | Visited graph candidates | Vectors in probed lists | Compressed distance codes | Hash bucket candidates |
| Memory | Vectors + graph links | Vectors + list IDs | Codes + codebooks | Hash tables / signatures |
| Build work | Incremental graph search | Centroid training | Codebook training | Hashing |
| Update support | Implementation-dependent | Implementation-dependent | Implementation-dependent | Implementation-dependent |
| Best For | Navigating a neighbor graph | Controlling the number of lists scanned | Memory constrained | Hash-based candidate selection |
Quantization can be combined with graph and IVF indexes. See the Faiss index reference for concrete implementations.