Robust Listwise Learning-to-Rank Approach for Database Query Optimizer

Xue Chen,Rui Xi,Yiheng Tang,Mengshu Hou
DOI: https://doi.org/10.1109/icpads60453.2023.00170
2023-01-01
Abstract:Finding the optimal query plan within a large planning space plays a crucial role in determining the performance of an SQL statement. Since traditional cost model-based approaches rely on manual parameter adjustments and DBA experience, the learned query optimizer has been proposed as an alternative to automatically determine the optimal query plan. However, recent methods face challenges in capturing all candidate query plan relationships and adapting to dynamic environments. In this paper, we design an improved learned query optimizer, Li-Lero, that could plug into the existing DBMS with non-intrusive modification. Inspirations from learning to rank, we employ a listwise approach to train a ranker to obtain the optimal with minimal execution time. Rather than computing the real execution time, such a ranker only measures the relative relationship of candidate plans. Furthermore, a robustness enhancement method is proposed to improve the dynamic adaptability of the model by utilizing the masking technique. We implement Li-Lero and demonstrate its outstanding performance using PostgreSQL. Comparative evaluations are conducted using two data sets with different data distributions, and results show that our proposed method achieves high prediction accuracy and is robust to dynamic environments.
What problem does this paper attempt to address?