用分块分解方法提升数据库查询结果预估的精度与速度
A Lightweight Learned Cardinality Estimation Model
- 将表切分为重叠小块,用张量分解建模每块数据分布
- 在多个数据集上超过一半查询实现精确估计,兼具高精度与低延迟
- 适合需要快速高准度预估的数据库系统开发者
基数估计是数据库管理系统中的基础任务,旨在不执行查询的情况下准确预测查询结果。然而,现有方法要么估计精度低,要么推理延迟高。同时实现高速与高精度对基数估计至关重要。本文提出一种名为 CoDe(Covering with Decompositions)的数据驱动新方法。CoDe 采用覆盖设计思想,将表划分为多个较小且重叠的片段,对每个片段使用张量分解精准建模其数据分布。此外,CoDe 引入创新算法,为每个查询选择最优拟合分布,并组合生成最终估计结果。通过多模型联合逼近分布,CoDe 在建模离散分布方面表现优异,同时保证计算效率。实验表明,该方法在多项指标上达到当前最优水平,在多个数据集上对超过一半的查询实现了绝对准确估计。
原文摘要 · Abstract (English)
Cardinality estimation is a fundamental task in database management systems, aiming to predict query results accurately without executing the queries. However, existing techniques either achieve low estimation accuracy or incur high inference latency. Simultaneously achieving high speed and accuracy becomes critical for the cardinality estimation problem. In this paper, we propose a novel data-driven approach called CoDe (Covering with Decompositions) to address this problem. CoDe employs the concept of covering design, which divides the table into multiple smaller, overlapping segments. For each segment, CoDe utilizes tensor decomposition to accurately model its data distribution. Moreover, CoDe introduces innovative algorithms to select the best-fitting distributions for each query, combining them to estimate the final result. By employing multiple models to approximate distributions, CoDe excels in effectively modeling discrete distributions and ensuring computational efficiency. Notably, experimental results show that our method represents a significant advancement in cardinality estimation, achieving state-of-the-art levels of both estimation accuracy and inference efficiency. Across various datasets, CoDe achieves absolute accuracy in estimating more than half of the queries.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。