arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.03386cs.DBcs.LG
收藏

比面包盒还大吗:面向真实工作负载的高效基数估计

Is it Bigger than a Breadbox: Efficient Cardinality Estimation for Real World Workloads

University of Pennsylvania(宾夕法尼亚大学);Google(谷歌);TU Darmstadt(图宾根大学);ETH(苏黎世联邦理工学院)

Zixuan Yi, Sami Abu-el-Haija, Yawen Wang, Teja Vemparala, Yannis Chronis, Yu Gan, Michael Burrows, Carsten Binnig, Bryan Perozzi, Ryan Marcus, Fatma Ozcan

AI总结:

针对传统基数估计误差高、学习型估计器运维复杂的问题,提出基于子查询模式哈希的在线局部回归估计方法,开销极低且准确率达SoTA水平,集成PostgreSQL后可显著提升查询效率。

摘要:

数据库引擎依靠代价模型生成高效的查询执行计划。实际实现采用启发式方法估计查询基数,通过调优经验参数来提升基准测试上的平均性能。实验表明,估计误差会随查询复杂度显著上升。另一种方案是基于学习的估计器,虽能提升准确率,但会增加运维复杂度,难以在实际中落地。我们注意到查询工作负载中存在高度重复的子查询模式,因此在线学习多个简单回归器,每个回归器对应一个局部模式。可通过子查询图结构的哈希值随机访问对应模式的回归器。该方法开销可忽略不计,在误差指标上可与当前最优(SoTA)的基于学习的方法相媲美。此外,将该方法集成到PostgreSQL中,相比传统方法在准确率和运行时间上均有显著提升,且与其他学习型基数估计器相比大幅降低了运维成本,是帕累托前沿上最实用高效的方案。具体而言,在IMDb数据集上模拟JOB-lite工作负载时,执行速度提升了7.5分钟(超过30%),而在线学习仅产生37秒的开销。

英文摘要:

DB engines produce efficient query execution plans by relying on cost models. Practical implementations estimate cardinality of queries using heuristics, with magic numbers tuned to improve average performance on benchmarks. Empirically, estimation error significantly grows with query complexity. Alternatively, learning-based estimators offer improved accuracy, but add operational complexity preventing their adoption in-practice. Recognizing that query workloads contain highly repetitive subquery patterns, we learn many simple regressors online, each localized to a pattern. The regressor corresponding to a pattern can be randomly-accessed using hash of graph structure of the subquery. Our method has negligible overhead and competes with SoTA learning-based approaches on error metrics. Further, amending PostgreSQL with our method achieves notable accuracy and runtime improvements over traditional methods and drastically reduces operational costs compared to other learned cardinality estimators, thereby offering the most practical and efficient solution on the Pareto frontier. Concretely, simulating JOB-lite workload on IMDb speeds-up execution by 7.5 minutes (>30%) while incurring only 37 seconds overhead for online learning.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑