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
- + High recall (95-99%)
- + Fast search (sub-ms)
- + No training required
- + Supports incremental updates
Cons
- - Higher memory usage
- - Slower build time
- - Cannot compress vectors
- - Not ideal for very large datasets
CLUSTER
IVF
Inverted File Index - Partitions vectors into clusters using k-means, then searches only relevant clusters.
Pros
- + Good scalability
- + Lower memory footprint
- + Can combine with PQ
- + Predictable performance
Cons
- - Requires training
- - Fixed cluster count
- - Lower recall at edges
- - Needs parameter tuning
Feature Comparison
| Feature | HNSW | IVF | PQ | LSH |
|---|---|---|---|---|
| Recall @10 | 95-99% | 80-95% | 70-85% | 60-80% |
| Query Speed | Fast | Medium | Fast | Fast |
| Memory | High | Medium | Low | Medium |
| Build Time | Slow | Medium | Slow | Fast |
| Updates | Yes | Rebuild | Rebuild | Yes |
| Best For | High recall, smaller datasets | Balanced, medium datasets | Memory constrained | Simple use cases |