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

Filtered Search Optimization

Optimize pgvector queries that combine vector similarity with metadata filters using partial and composite indexing strategies.

The Filtered Search Problem

Real queries often combine a vector search with a metadata WHERE filter. Naive combinations can defeat the vector index and become slow.

SELECT id FROM docs
WHERE category = 'news'
ORDER BY embedding <=> '[...]'::vector
LIMIT 10;

Why Filters Hurt Recall

ANN indexes return approximate nearest neighbors before the filter applies. If most candidates are filtered out, you may get fewer than LIMIT results — this is over-filtering.

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