0PricingLogin
Vector Databases: Pinecone, Weaviate & pgvector · Lesson

HNSW Indexing for Recall

Explore HNSW indexing for pgvector to achieve higher recall rates in similarity searches, balancing speed and accuracy.

Boost Recall with HNSW

Welcome to HNSW indexing! In the previous lesson, we explored IVFFlat for speed. Now, we'll dive into Hierarchical Navigable Small World (HNSW), an advanced indexing technique in pgvector.

HNSW is excellent when you need to find most of the relevant results, even if it means a slight trade-off in query speed compared to IVFFlat. This is known as high recall.

HNSW vs. IVFFlat: A Quick Look

Remember IVFFlat indexes? They partition data for faster, approximate searches, optimizing for speed. HNSW takes a different approach to prioritize recall.

  • IVFFlat: Faster queries, good enough recall.
  • HNSW: Higher recall (finds more true positives), potentially slower build and query times.

Choosing between them depends on your application's needs: speed or comprehensive results.

All lessons in this course

  1. IVFFlat Indexing for Speed
  2. HNSW Indexing for Recall
  3. Query Performance Tuning
  4. Filtered Search Optimization
← Back to Vector Databases: Pinecone, Weaviate & pgvector