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

Glue:自适应合并单表基数估计连接查询大小

Glue: Adaptively Merging Single Table Cardinality to Estimate Join Query Size

Alibaba Group(阿里巴巴集团);Renmin University of China(中国人民大学)

Rong Zhu, Tianjing Zeng, Andreas Pfadler, Wei Chen, Bolin Ding, Jingren Zhou

摘要:

基数估计(CardEst)是查询优化器的核心组件,在DBMS中生成高质量查询计划方面起着重要作用。在过去的几十年里,CardEst问题已经被广泛研究,使用传统的和ML增强的方法。然而,CardEst中最困难的问题,即,如何估计多个表上的连接查询大小尚未得到广泛解决。现有的方法要么依赖于独立性假设,要么采用负担沉重的技术,其性能还远不能令人满意。更糟糕的是,现有的CardEst方法通常被设计为优化一个目标,即,推理速度或估计精度,不能适应不同的场合。在本文中,我们提出了一个非常通用的框架,称为胶水,以应对这些挑战。它的核心思想是优雅地解耦不同表之间的相关性,并对单个表CardEst结果进行丢失合并,以估计连接查询的大小。Glue支持使用任何现有的CardEst方法获得单个表式CardEst结果,并可以处理任何复杂的连接模式。因此,它很容易适应具有不同性能要求的不同场景,即,快速估计时间的OLTP或高估计精度的OLAP。同时,我们表明,胶水可以无缝集成到计划搜索过程中,并能够支持计数不同数量的值。所有这些属性都展示了在现实世界的DBMS中部署Glue的潜在优势。

英文摘要:

Cardinality estimation (CardEst), a central component of the query optimizer, plays a significant role in generating high-quality query plans in DBMS. The CardEst problem has been extensively studied in the last several decades, using both traditional and ML-enhanced methods. Whereas, the hardest problem in CardEst, i.e., how to estimate the join query size on multiple tables, has not been extensively solved. Current methods either reply on independence assumptions or apply techniques with heavy burden, whose performance is still far from satisfactory. Even worse, existing CardEst methods are often designed to optimize one goal, i.e., inference speed or estimation accuracy, which can not adapt to different occasions. In this paper, we propose a very general framework, called Glue, to tackle with these challenges. Its key idea is to elegantly decouple the correlations across different tables and losslessly merge single table CardEst results to estimate the join query size. Glue supports obtaining the single table-wise CardEst results using any existing CardEst method and can process any complex join schema. Therefore, it easily adapts to different scenarios having different performance requirements, i.e., OLTP with fast estimation time or OLAP with high estimation accuracy. Meanwhile, we show that Glue can be seamlessly integrated into the plan search process and is able to support counting distinct number of values. All these properties exhibit the potential advances of deploying Glue in real-world DBMS.

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

↑