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

DBMS中的基数估计:一个综合基准评估

Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation

Alibaba Group(阿里巴巴集团);MIT(麻省理工学院);Nanyang Technological University(南洋理工大学);Peking University(北京大学)

Yuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu, Jingyi Yang, Liang Wei Tan, Kai Zeng, Gao Cong, Yanzhao Qin, Andreas Pfadler, Zhengping Qian, Jingren Zhou, Jiangneng Li, Bin Cui

摘要:

基数估计(CardEst)在为DBMS中的查询优化器生成高质量的查询计划方面起着重要作用。在过去的十年中,已经提出了越来越多的先进的CardEst方法(特别是ML为基础的)具有出色的估计精度和推理延迟。然而,目前还没有研究系统地评估这些方法的质量,并回答根本问题:这些方法在多大程度上可以提高查询优化器在现实世界中的性能,这是CardEst方法的最终目标。在本文中,我们全面和系统地比较了CardEst方法在一个真正的DBMS的有效性。我们为CardEst建立了一个新的基准,它包含一个新的复杂的真实世界的数据集STATS和一个多样化的查询工作负载STATS-CEB。我们将多个最具代表性的CardEst方法集成到开源数据库系统PostgreSQL中,并全面评估它们在提高查询计划质量方面的真正有效性,以及影响其适用性的其他重要方面,从推理延迟,模型大小和训练时间,到更新效率和准确性。我们获得了一些关键的调查结果的CardEst方法,在不同的数据和查询设置。此外,我们还发现,在查询优化过程中,广泛使用的估计精度度量(Q-Error)无法区分不同子计划查询的重要性,从而无法真实反映CardEst方法生成的查询计划质量。因此,我们提出了一个新的度量P-Error来评估CardEst方法的性能,它克服了Q-Error的局限性,能够反映CardEst方法的整体端到端性能。我们已经在https://github.com/Nathaniel-Han/End-to-End-CardEst-Benchmark上公开了所有的基准数据和评估代码。

英文摘要:

Cardinality estimation (CardEst) plays a significant role in generating high-quality query plans for a query optimizer in DBMS. In the last decade, an increasing number of advanced CardEst methods (especially ML-based) have been proposed with outstanding estimation accuracy and inference latency. However, there exists no study that systematically evaluates the quality of these methods and answer the fundamental problem: to what extent can these methods improve the performance of query optimizer in real-world settings, which is the ultimate goal of a CardEst method. In this paper, we comprehensively and systematically compare the effectiveness of CardEst methods in a real DBMS. We establish a new benchmark for CardEst, which contains a new complex real-world dataset STATS and a diverse query workload STATS-CEB. We integrate multiple most representative CardEst methods into an open-source database system PostgreSQL, and comprehensively evaluate their true effectiveness in improving query plan quality, and other important aspects affecting their applicability, ranging from inference latency, model size, and training time, to update efficiency and accuracy. We obtain a number of key findings for the CardEst methods, under different data and query settings. Furthermore, we find that the widely used estimation accuracy metric(Q-Error) cannot distinguish the importance of different sub-plan queries during query optimization and thus cannot truly reflect the query plan quality generated by CardEst methods. Therefore, we propose a new metric P-Error to evaluate the performance of CardEst methods, which overcomes the limitation of Q-Error and is able to reflect the overall end-to-end performance of CardEst methods. We have made all of the benchmark data and evaluation code publicly available at https://github.com/Nathaniel-Han/End-to-End-CardEst-Benchmark.

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

↑