CardBench:关系数据库中学习型基数估计的基准
CardBench: A Benchmark for Learned Cardinality Estimation in Relational Databases
AI总结:
本文发布CardBench基准,包含20个真实数据库的数千查询,用于系统训练评估学习型基数估计模型,实验表明零样本在单表查询有效但连接下降,微调可减少开销。
摘要:
基数估计对于在关系数据库中实现高查询性能至关重要。近期提出了学习型基数估计模型以提高准确性,但目前缺乏系统性的基准或数据集,使得研究人员无法评估新型学习方法取得的进展,甚至无法系统地开发新的学习方法。本文发布了一个基准,包含针对20个不同真实世界数据库的数千个查询,用于学习型基数估计。与其他初始基准不同,我们的基准更具多样性,可用于系统地训练和测试学习模型。利用该基准,我们探索了学习型基数估计能否以零样本方式迁移到未见过的数据集上。我们训练了基于GNN和基于transformer的模型,在三种设置下研究该问题:1-) 基于实例,2-) 零样本,3-) 微调。结果表明,尽管在简单的单表查询的零样本基数估计中取得了有希望的结果,但一旦加入连接操作,准确性就会下降。然而,我们表明通过微调,我们仍能利用预训练模型进行基数估计,与特定实例模型相比,显著减少了训练开销。我们开源了收集统计信息、生成查询和训练数据集的脚本,以促进更广泛的研究,也鼓励ML社区在基数估计这一重要问题上展开研究,特别是改进预训练基数估计等近期方向。
英文摘要:
Cardinality estimation is crucial for enabling high query performance in relational databases. Recently learned cardinality estimation models have been proposed to improve accuracy but there is no systematic benchmark or datasets which allows researchers to evaluate the progress made by new learned approaches and even systematically develop new learned approaches. In this paper, we are releasing a benchmark, containing thousands of queries over 20 distinct real-world databases for learned cardinality estimation. In contrast to other initial benchmarks, our benchmark is much more diverse and can be used for training and testing learned models systematically. Using this benchmark, we explored whether learned cardinality estimation can be transferred to an unseen dataset in a zero-shot manner. We trained GNN-based and transformer-based models to study the problem in three setups: 1-) instance-based, 2-) zero-shot, and 3-) fine-tuned. Our results show that while we get promising results for zero-shot cardinality estimation on simple single table queries; as soon as we add joins, the accuracy drops. However, we show that with fine-tuning, we can still utilize pre-trained models for cardinality estimation, significantly reducing training overheads compared to instance specific models. We are open sourcing our scripts to collect statistics, generate queries and training datasets to foster more extensive research, also from the ML community on the important problem of cardinality estimation and in particular improve on recent directions such as pre-trained cardinality estimation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。