向量数据库中的过滤近邻搜索:系统设计与性能分析
Filtered Approximate Nearest Neighbor Search in Vector Databases: System Design and Performance Analysis
AI总结:
本文研究了向量数据库中过滤近邻搜索的系统设计与性能,通过MoReVec数据集评估了不同引擎的过滤策略表现,揭示了算法适应性对索引性能的影响,并提出了GLS相关度量指标。
摘要:
检索增强生成(RAG)应用越来越多地依赖于过滤近邻搜索(FANNS)来结合语义检索与元数据约束。尽管已提出了一些FANNS的算法创新,但仍然缺乏对向量数据库中通用过滤策略性能的理解。在本工作中,我们系统化地梳理了过滤策略的分类,并评估了其在FAISS、Milvus和pgvector中的整合。为了提供一个稳健的基准框架,我们引入了一个新的关系数据集MoReVec,包含两个表,具有768维的文本嵌入和丰富的元数据属性。我们进一步提出了全局-局部选择性(GLS)相关度量指标,以量化过滤器与查询向量之间的关系。我们的实验发现,引擎内的算法适应性经常会覆盖原始索引性能。具体而言,我们发现:(1)Milvus通过混合近似/精确执行实现了优越的召回稳定性;(2)pgvector的基于成本的查询优化器经常选择次优的执行计划,倾向于选择近似索引扫描,即使精确顺序扫描在可比延迟下可以实现完美召回;(3)基于分区的索引(IVFFlat)在低选择性查询中优于基于图的索引(HNSW)。为了促进这一分析,我们将广泛使用的ANN-Benchmarks扩展以支持过滤向量搜索,并使其在线可用。最后,我们将我们的发现综合成一套实用指南,用于选择索引类型和配置查询优化器以适应混合搜索工作负载。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。