Cardinality estimation using normalizing flow

被引:2
|
作者
Wang, Jiayi [1 ]
Chai, Chengliang [2 ]
Liu, Jiabin [1 ]
Li, Guoliang [1 ]
机构
[1] Tsinghua Univ, Dept Comp Sci & Technol, Beijing, Peoples R China
[2] Beijing Inst Technol, Dept Comp Sci & Technol, Beijing, Peoples R China
来源
VLDB JOURNAL | 2024年 / 33卷 / 02期
关键词
Cardinality estimation; Query optimization; AI for DB; PREDICTION;
D O I
10.1007/s00778-023-00808-x
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
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
页数:26
相关论文
共 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] Enabling XPath optional axes cardinality estimation using path synopses
    Soldak, Yury
    Lukichev, Maxim
    ADVANCES IN DATABASES AND INFORMATION SYSTEMS, PROCEEDINGS, 2008, 5207 : 279 - 294
  • [23] 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
  • [24] Address Block Counting Using Two-Tier Cardinality Estimation
    Yoon, Myungkeun
    Kim, Young Jae
    IEEE ACCESS, 2019, 7 : 125754 - 125761
  • [25] Learning complex predicates for cardinality estimation using recursive neural networks
    Wang, Zhi
    Duan, Hancong
    Cheng, Yamin
    Min, Geyong
    INFORMATION SYSTEMS, 2024, 124
  • [26] 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
  • [27] 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
  • [28] 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
  • [29] Sample-Efficient Cardinality Estimation Using Geometric Deep Learning
    Reiner, Silvan
    Grossniklaus, Michael
    PROCEEDINGS OF THE VLDB ENDOWMENT, 2023, 17 (04): : 740 - 752
  • [30] 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):