保真度概要:近似向量搜索的预执行计划选择
Fidelity Synopses: Pre-Execution Plan Selection for Approximate Vector Search
AI总结:
本文提出保真度概要方法,通过预执行选择向量搜索的最优配置,在LAION基准测试中可将成本降至静态部署的0.72倍,且无需额外内存。
摘要:
向量搜索已成为一种具有多种物理实现方式的数据库算子,包括不同的索引族、构建时与搜索时参数,以及压缩或驻留磁盘的变体。每种实现都在成本与保真度之间进行权衡,其中保真度指的是某一配置返回的查询精确前k个最近邻的比例。然而,部署系统通常会离线选择一种配置并将其用于所有查询,因此系统是为应对最难的查询而配置的,其余查询则会产生过度开销。在包含4种嵌入模型、580万条数据的LAION基准测试中,对每个查询运行足以满足其需求的最便宜配置,可在典型场景下将成本大致减半。要利用这一优势,需要在运行前预测每种配置的保真度,而这一任务颇具挑战性,因为保真度正是近似索引所规避的精确搜索的定义所在。关系型优化器通过离线概要解决了基数估计的类似问题;本文针对向量搜索提出了一种保真度概要。该概要将嵌入空间划分为若干围绕一组地标点的单元,并为每个单元和每种配置记录该配置在查询样本中达到保真度目标的频率。在查询时,通过最近地标点查找可得到每种配置的校准估计值,优化器据此选择配置,使工作负载未达目标的次数不超过其允许的要求。本文测试了该概要所依赖的两个前提:保真度在嵌入空间中平滑变化,且其损失因配置而异。在与静态部署相同的要求下构建的测试中,由概要引导的选择在模型与查询方向的16种组合中均降低了成本,中位数为静态部署成本的0.72倍,且每次查询的批量查找耗时为21至32微秒。该节省效果在相同索引中优于最佳静态选择,且在单个索引内无需额外内存即可实现。
英文摘要:
Vector search has become a database operator with many physical implementations: different index families, build-time and search-time parameters, and compressed or disk-resident variants. Each trades cost against fidelity, the fraction of a query's exact top-k nearest neighbors that a configuration returns. Deployments nevertheless choose one configuration offline and use it for every query, so they are sized for their hardest queries and overpay for the rest. On a 5.8M-item LAION benchmark with four embedding models, running each query on the cheapest configuration that suffices for it would roughly halve the cost in a typical setting. Exploiting this requires predicting each configuration's fidelity before running it, which is hard because fidelity is defined by the very exact search that approximate indexes avoid. Relational optimizers solve the analogous problem for cardinality with offline synopses; we propose one for vector search. A fidelity synopsis divides the embedding space into cells around a set of landmarks and records, for every cell and configuration, how often that configuration met a fidelity target on a sample of queries. At query time, one nearest-landmark lookup yields a calibrated estimate for every configuration, and an optimizer chooses configurations so that the workload misses the target no more often than its requirement allows. We test the two premises the synopsis relies on, that fidelity varies smoothly across the embedding space and that its loss is specific to each configuration. Held to the same requirement a static deployment is built to meet, synopsis-guided selection lowers cost in all 16 combinations of model and query direction, to a median of 0.72x the static deployment, with a batched lookup of 21-32 microseconds per query. The saving persists against the best static choice among the same indexes, and within a single index at no extra memory.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。