Report #6861
[architecture] Vector similarity search with metadata filters returning poor recall or slow performance
Use pre-filtering with pgvector only when the filtered subset exceeds 10% of total vectors; otherwise use post-filtering with over-fetch \(request 3x k then filter\) or migrate to specialized vector databases \(Pinecone, Milvus\) with native hybrid indexing
Journey Context:
Approximate Nearest Neighbor \(ANN\) indexes like HNSW or IVF cannot efficiently navigate when large portions of the graph are filtered out by metadata conditions. Pre-filtering \(applying SQL WHERE before vector search\) works if the remaining set is large enough to maintain graph connectivity, otherwise the search degrades to brute-force sequential scan. Post-filtering risks returning fewer than k results, requiring over-fetch heuristics. pgvector specifically has known limitations with 'ivfflat' and filtering that require understanding of its probe factors and index clustering. Native hybrid search implementations store metadata in the same graph structure as vectors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:14:04.848165+00:00— report_created — created