arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.16110cs.DB
收藏

ByteCard:基于学习的基数估计增强字节跳动数据仓库

ByteCard: Enhancing ByteDance's Data Warehouse with Learned Cardinality Estimation

Yuxing Han, Haoyu Wang, Lixiang Chen, Yifeng Dong, Xing Chen, Benquan Yu, Chengcheng Yang, Weining Qian

AI总结:

针对字节跳动ByteHouse数据仓库传统基数估计误差大、影响查询效率的问题,开发了可高效训练集成、平衡准确性与实用性的学习型基数估计框架ByteCard,使查询第99百分位延迟最高降30%,并分享了工程落地经验。

摘要:

基数估计是现代数据仓库的核心组成部分,也是一项长期存在的挑战。ByteHouse(字节跳动用于艾字节级环境下海量数据分析的云原生引擎)服务于众多内部决策业务场景。随着对ByteHouse的需求不断增长,基数估计成为高效处理查询的瓶颈。具体而言,ByteHouse现有的查询优化器采用传统的类Selinger基数估计器,会产生较大的估计误差,导致查询计划并非最优。为在保持合理推理开销的同时提高基数估计的准确性,我们开发了ByteCard框架,可实现学习型基数估计器的高效训练与集成。此外,ByteCard适配了基数估计领域的最新进展,构建出能够平衡准确性与实用性(如推理延迟、模型大小、训练开销)的模型。在多个优化场景中,将ByteHouse现有的基数估计器替换为ByteCard后,我们观察到查询处理速度显著提升。在真实数据集上的评估表明,集成ByteCard可使第99百分位延迟最高降低30%。最后,我们分享了在工程化实现先进基数估计器方面的宝贵经验,这些经验可助力ByteHouse未来在关键查询执行路径上集成更多基于学习的解决方案。

英文摘要:

Cardinality estimation is a critical component and a longstanding challenge in modern data warehouses. ByteHouse, ByteDance's cloud-native engine for extensive data analysis in exabyte-scale environments, serves numerous internal decision-making business scenarios. With the increasing demand for ByteHouse, cardinality estimation becomes the bottleneck for efficiently processing queries. Specifically, the existing query optimizer of ByteHouse uses the traditional Selinger-like cardinality estimator, which can produce substantial estimation errors, resulting in suboptimal query plans. To improve cardinality estimation accuracy while maintaining a practical inference overhead, we develop a framework ByteCard that enables efficient training and integration of learned cardinality estimators. Furthermore, ByteCard adapts recent advances in cardinality estimation to build models that can balance accuracy and practicality (e.g., inference latency, model size, training overhead). We observe significant query processing speed-up in ByteHouse after replacing the existing cardinality estimator with ByteCard for several optimization scenarios. Evaluations on real-world datasets show the integration of ByteCard leads to an improvement of up to 30% in the 99th quantile of latency. At last, we share our valuable experience in engineering advanced cardinality estimators. This experience can help ByteHouse integrate more learning-based solutions on the critical query execution path in the future.

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

↑