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

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

4 Scopus citations

Abstract

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.

Original languageEnglish
Title of host publicationSIGMOD-Companion 2024 - Companion of the 2024 International Conferaence on Management of Data
PublisherAssociation for Computing Machinery
Pages41-54
Number of pages14
ISBN (Electronic)9798400704222
DOIs
StatePublished - 9 Jun 2024
Event2024 International Conference on Management of Data, SIGMOD 2024 - Santiago, Chile
Duration: 9 Jun 202415 Jun 2024

Publication series

NameProceedings of the ACM SIGMOD International Conference on Management of Data
ISSN (Print)0730-8078

Conference

Conference2024 International Conference on Management of Data, SIGMOD 2024
Country/TerritoryChile
CitySantiago
Period9/06/2415/06/24

Keywords

  • bytecard
  • bytehouse
  • inference engine
  • learned cardinality estimators
  • modelforge service
  • query optimization

Fingerprint

Dive into the research topics of 'ByteCard: Enhancing ByteDance's Data Warehouse with Learned Cardinality Estimation'. Together they form a unique fingerprint.

Cite this