Cost-based or Learning-based? A Hybrid Query Optimizer for Query Plan Selection

被引:18
|
作者
Yu, Xiang [1 ]
Chai, Chengliang [1 ]
Li, Guoliang [1 ]
Liu, Jiabin [1 ]
机构
[1] Tsinghua Univ, Dept Comp Sci, Beijing, Peoples R China
来源
PROCEEDINGS OF THE VLDB ENDOWMENT | 2022年 / 15卷 / 13期
关键词
D O I
10.14778/3565838.3565846
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Traditional cost-based optimizers are efficient and stable to generate optimal plans for simple SQL queries, but they may not generate high-quality plans for complicated queries. Thus learning-based optimizers have been proposed recently that can learn high-quality plans based on past experiences. However, learning-based optimizers cannot work well for dynamic workloads that have different distributions with training examples. In this paper, we propose a hybrid optimizer that adopts the advantages and avoids the shortcomings of these two types of optimizers, which first generates high-quality candidate plans from each type of optimizers and then selects the best plan from the candidates. There are two challenges. (1) How to generate high-quality candidates? We propose a hint-based candidate generation method that leverages the learning-based method to generate highly beneficial hints and then uses a cost-based method to supplement the hints to generate complete plans as candidates. (2) How to evaluate different candidate plans and select the best one? We propose an uncertainty-based optimal plan selection model, which predicts the execution time and the uncertainty for each plan. The uncertainty reflects the confidence of the execution time prediction. We select the plan using the uncertainty model. Experiment results on real datasets showed that our method outperformed the stateof-the-art baselines, and reduced the total latency by 25% and the tail latency by 65% compared to PostgreSQL.
引用
收藏
页码:3924 / 3936
页数:13
相关论文
共 50 条
  • [1] Geno: Cost-based Heterogeneous Fusion Query Optimizer
    Tu, Yao-Feng
    Chen, Xiao-Qiang
    Zhou, Shi-Jun
    Bian, Fu-Sheng
    Wu, Fei
    Chen, Bing
    [J]. Ruan Jian Xue Bao/Journal of Software, 2022, 33 (03): : 774 - 796
  • [2] Plan Before You Execute: A Cost-Based Query Optimizer for Attributed Graph Databases
    Das, Soumyava
    Goyal, Ankur
    Chakravarthy, Sharma
    [J]. BIG DATA ANALYTICS AND KNOWLEDGE DISCOVERY, DAWAK 2016, 2016, 9829 : 314 - 328
  • [3] Counting, enumerating, and sampling of execution plans in a cost-based query optimizer
    Waas, F
    Galindo-Legaria, C
    [J]. SIGMOD RECORD, 2000, 29 (02) : 499 - 509
  • [4] Cost-based Query Optimization for XPath
    Li, Dong
    Chen, Wenhao
    Liang, Xiaochong
    Guan, Jida
    Xu, Yang
    Lu, Xiuyu
    [J]. APPLIED MATHEMATICS & INFORMATION SCIENCES, 2014, 8 (04): : 1935 - 1948
  • [5] GSLPI: a Cost-based Query Progress Indicator
    Li, Jiexing
    Nehme, Rimma V.
    Naughton, Jeffrey
    [J]. 2012 IEEE 28TH INTERNATIONAL CONFERENCE ON DATA ENGINEERING (ICDE), 2012, : 678 - 689
  • [6] Cost-based Optimization of Multistore Query Plans
    Forresi, Chiara
    Francia, Matteo
    Gallinucci, Enrico
    Golfarelli, Matteo
    [J]. INFORMATION SYSTEMS FRONTIERS, 2023, 25 (05) : 1925 - 1951
  • [7] Cost-based Optimization of Multistore Query Plans
    Chiara Forresi
    Matteo Francia
    Enrico Gallinucci
    Matteo Golfarelli
    [J]. Information Systems Frontiers, 2023, 25 : 1925 - 1951
  • [8] A review of different cost-based distributed query optimizers
    Manik Sharma
    Gurvinder Singh
    Rajinder Singh
    [J]. Progress in Artificial Intelligence, 2019, 8 : 45 - 62
  • [9] A review of different cost-based distributed query optimizers
    Sharma, Manik
    Singh, Gurvinder
    Singh, Rajinder
    [J]. PROGRESS IN ARTIFICIAL INTELLIGENCE, 2019, 8 (01) : 45 - 62
  • [10] Cost-based query optimization for multi reachability joins
    Cheng, Jiefeng
    Yu, Jeffrey Xu
    Ding, Bolin
    [J]. ADVANCES IN DATABASES: CONCEPTS, SYSTEMS AND APPLICATIONS, 2007, 4443 : 18 - +