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

FeatureHNSWIVFPQLSH
Recall @1095-99%80-95%70-85%60-80%
Query SpeedFastMediumFastFast
MemoryHighMediumLowMedium
Build TimeSlowMediumSlowFast
UpdatesYesRebuildRebuildYes
Best ForHigh recall, smaller datasetsBalanced, medium datasetsMemory constrainedSimple use cases