Cardinality estimation using normalizing flow

被引:0
|
作者
Jiayi Wang
Chengliang Chai
Jiabin Liu
Guoliang Li
机构
[1] Tsinghua University,Department of Computer Science and Technology
[2] Beijing Institute of Technology,Department of Computer Science and Technology
关键词
Cardinality estimation; Query optimization; AI for DB;
D O I
暂无
中图分类号
学科分类号
摘要
Cardinality estimation is one of the most important problems in query optimization. Recently, machine learning-based techniques have been proposed to effectively estimate cardinality, which can be broadly classified into query-driven and data-driven approaches. Query-driven approaches learn a regression model from a query to its cardinality, while data-driven approaches learn a distribution of tuples, select some samples that satisfy a SQL query, and use the data distributions of these selected tuples to estimate the cardinality of the SQL query. As query-driven methods rely on training queries, the estimation quality is not reliable when there are no high-quality training queries, while data-driven methods have no such limitation and have high adaptivity. In this work, we focus on data-driven methods. A good data-driven model should achieve three optimization goals. First, the model needs to capture data dependencies between columns and support large domain sizes (achieving high accuracy). Second, the model should achieve high inference efficiency, because many data samples are needed to estimate the cardinality (achieving low inference latency). Third, the model should not be too large (achieving a small model size). However, existing data-driven methods cannot simultaneously optimize the three goals. To address the limitations, we propose a novel cardinality estimator FACE\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\texttt{FACE}$$\end{document}, which leverages the normalizing flow-based model to learn a continuous joint distribution for relational data. FACE\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\texttt{FACE}$$\end{document} can transform a complex distribution over continuous random variables into a simple distribution (e.g., multivariate normal distribution) and use the probability density to estimate the cardinality for both sequential queries and parallel queries. First, we design a dequantization method to make data more “continuous.” Second, we propose encoding and indexing techniques to handle Like predicates for string data. Third, we propose a Monte Carlo method to estimate the cardinality based on the FACE\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\texttt{FACE}$$\end{document} model. Fourth, we propose a grouping technique to process parallel queries. Fifth, we discuss how to support join queries. Experimental results show that our method significantly outperforms existing approaches in terms of estimation accuracy while keeping similar latency and model size.
引用
下载
收藏
页码:323 / 348
页数:25
相关论文
共 50 条
  • [21] Network cardinality estimation using max consensus: the case of Bernoulli trials
    Lucchese, Riccardo
    Varagnolo, Damian
    Delvenne, Jean-Charles
    Hendrickx, Julien
    2015 54TH IEEE CONFERENCE ON DECISION AND CONTROL (CDC), 2015, : 895 - 901
  • [22] Learning complex predicates for cardinality estimation using recursive neural networks
    Wang, Zhi
    Duan, Hancong
    Cheng, Yamin
    Min, Geyong
    INFORMATION SYSTEMS, 2024, 124
  • [23] Address Block Counting Using Two-Tier Cardinality Estimation
    Yoon, Myungkeun
    Kim, Young Jae
    IEEE ACCESS, 2019, 7 : 125754 - 125761
  • [24] QardEst: Using Quantum Machine Learning for Cardinality Estimation of Join Queries
    Kittelmann, Florian
    Sulimov, Pavel
    Stockinger, Kurt
    PROCEEDINGS OF THE 1ST WORKSHOP ON QUANTUM COMPUTING AND QUANTUM-INSPIRED TECHNOLOGY FOR DATA-INTENSIVE SYSTEMS AND APPLICATIONS, Q-DATA, CO-LOCATED WITH ACM INTERNATIONAL CONFERENCE ON DATA MANAGEMENT, SIGMOD, 2024, : 2 - 13
  • [25] Cardinality estimation of activity trajectory similarity queries using deep learning
    Tian, Ruijie
    Zhang, Weishi
    Wang, Fei
    Zhou, Jingchun
    Alhudhaif, Adi
    Alenezi, Fayadh
    INFORMATION SCIENCES, 2023, 646
  • [26] Cardinality Estimation in a Virtualized Network Device Using Online Machine Learning
    Cohen, Reuven
    Nezri, Yuval
    IEEE-ACM TRANSACTIONS ON NETWORKING, 2019, 27 (05) : 2098 - 2110
  • [27] Query result size estimation using the trapezoidal attribute cardinality map
    Oommen, BJ
    Thiyagarajah, M
    2000 INTERNATIONAL DATABASE ENGINEERING AND APPLICATIONS SYMPOSIUM - PROCEEDINGS, 2000, : 236 - 242
  • [28] Sample-Efficient Cardinality Estimation Using Geometric Deep Learning
    Reiner, Silvan
    Grossniklaus, Michael
    PROCEEDINGS OF THE VLDB ENDOWMENT, 2023, 17 (04): : 740 - 752
  • [29] Principal component density estimation for scenario generation using normalizing flows
    Cramer, Eike
    Mitsos, Alexander
    Tempone, Raul
    Dahmen, Manuel
    DATA-CENTRIC ENGINEERING, 2022, 3 (1-3):
  • [30] Deep Hashing-based Dynamic Stock Correlation Estimation via Normalizing Flow
    Zheng, Xiaolin
    Liu, Mengpu
    Zhu, Mengying
    PROCEEDINGS OF THE THIRTY-SECOND INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE, IJCAI 2023, 2023, : 4993 - 5001