pgvector plus a tenant filter found 4% of the right results

On 100,000 vectors, a pgvector HNSW index with a tenant filter that matches 1 percent of rows returned only 3.6 percent of the true nearest neighbors at the default ef_search of 40 (our lab, 2026).

Four fixes worked: iterative scans reached recall 0.84 at 5.6 ms, a tenant B-tree with exact sort reached 0.9995 at 1.4 ms, partial indexes per large tenant, and Qdrant's filter-aware HNSW reached

An exact scan of one tenant's 1,000 vectors took 0.23 ms in memory, so small-tenant RAG products rarely need a dedicated vector database for speed.

Read the full post

Read the full post