arXiv:2602.11443cs.DBcs.IR2026-02

对比多种向量数据库过滤搜索策略,发现执行方式比索引本身更重要。

Filtered Approximate Nearest Neighbor Search in Vector Databases: System Design and Performance Analysis

  • 构建新数据集和相关性指标,系统评估过滤搜索性能
  • 混合执行模式提升召回率稳定性,分区索引在低选择性下更优
  • 为实际应用提供索引选型与查询优化建议,适合工程落地

检索增强生成(RAG)应用越来越多依赖带元数据约束的过滤近似最近邻搜索(FANNS)。尽管已有算法创新,但通用过滤策略在向量数据库中的表现仍缺乏系统理解。本文系统化梳理过滤策略分类,评估其在FAISS、Milvus和pgvector中的集成效果。为建立可靠基准,我们引入新关系型数据集MoReVec,包含两个表,768维文本嵌入及丰富元数据属性。提出全局-局部可区分性(GLS)相关性度量以量化过滤条件与查询向量的关系。实验表明:(1)Milvus通过混合近似/精确执行实现更高召回稳定性;(2)pgvector的成本优化器常选择次优计划,即使精确顺序扫描也能在相近延迟下实现完美召回却仍偏好近似索引扫描;(3)对于低选择性查询,基于分区的索引(IVFFlat)优于基于图的索引(HNSW)。为支持分析,我们扩展了广泛使用的ANN-Benchmarks以支持过滤向量搜索,并在线公开。最终,我们将成果总结为一套面向混合搜索工作负载的索引选型与查询优化配置指南。

原文摘要 · Abstract (English)

Retrieval-Augmented Generation (RAG) applications increasingly rely on Filtered Approximate Nearest Neighbor Search (FANNS) to combine semantic retrieval with metadata constraints. While algorithmic innovations for FANNS have been proposed, there remains a lack of understanding regarding how generic filtering strategies perform within Vector Databases. In this work, we systematize the taxonomy of filtering strategies and evaluate their integration into FAISS, Milvus, and pgvector. To provide a robust benchmarking framework, we introduce a new relational dataset, \textit{MoReVec}, consisting of two tables, featuring 768-dimensional text embeddings and a rich schema of metadata attributes. We further propose the \textit{Global-Local Selectivity (GLS)} correlation metric to quantify the relationship between filters and query vectors. Our experiments reveal that algorithmic adaptations within the engine often override raw index performance. Specifically, we find that: (1) \textit{Milvus} achieves superior recall stability through hybrid approximate/exact execution; (2) \textit{pgvector}'s cost-based query optimizer frequently selects suboptimal execution plans, favoring approximate index scans even when exact sequential scans would yield perfect recall at comparable latency; and (3) partition-based indexes (IVFFlat) outperform graph-based indexes (HNSW) for low-selectivity queries. To facilitate this analysis, we extend the widely-used \textit{ANN-Benchmarks} to support filtered vector search and make it available online. Finally, we synthesize our findings into a set of practical guidelines for selecting index types and configuring query optimizers for hybrid search workloads.

向量数据库近似搜索过滤查询性能优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。