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.
翻译:红心估计( CardEst) 在为 DBMS 优化查询器生成高质量查询计划方面起着重要作用。 在过去的十年中,提出了越来越多的高级卡斯特方法(特别是基于 ML ), 其估算准确性和推推论性优异。然而,没有一项研究系统地评估这些方法的质量并解决根本问题:这些方法在多大程度上能改善真实世界环境中查询优化器的性能,这是卡通方法的最终目标。在本文中,我们全面和系统地比较了卡通方法在真实的 DBMS 中的有效性。我们为卡通方法建立了一个新的基准,其中包含新的复杂真实世界数据集STATS和不同查询工作量。我们将这些最有代表性的卡通方法纳入开放数据库系统 PostgreSQL, 全面评价其在改进查询计划质量方面的真实效力,以及影响其应用性的其他重要方面,从推推度、模型大小、培训时间到更新的卡通方法,因此无法在真实的卡路端评估中,我们无法广泛反映所有数据库的准确性能评估方法。