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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Han, Yuxing, Wang, Haoyu, Chen, Lixiang, Dong, Yifeng, Chen, Xing, Yu, Benquan, Yang, Chengcheng, Qian, Weining
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913309819666432
author Han, Yuxing
Wang, Haoyu
Chen, Lixiang
Dong, Yifeng
Chen, Xing
Yu, Benquan
Yang, Chengcheng
Qian, Weining
author_facet Han, Yuxing
Wang, Haoyu
Chen, Lixiang
Dong, Yifeng
Chen, Xing
Yu, Benquan
Yang, Chengcheng
Qian, Weining
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2403_16110
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle ByteCard: Enhancing ByteDance's Data Warehouse with Learned Cardinality Estimation
Han, Yuxing
Wang, Haoyu
Chen, Lixiang
Dong, Yifeng
Chen, Xing
Yu, Benquan
Yang, Chengcheng
Qian, Weining
Databases
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.
title ByteCard: Enhancing ByteDance's Data Warehouse with Learned Cardinality Estimation
topic Databases
url https://arxiv.org/abs/2403.16110