Simple Adaptive Query Processing vs. Learned Query Optimizers: Observations and Analysis
Yunjia Zhang, Yannis Chronis, Jignesh M. Patel, Theodoros Rekatsinas
摘要
There have been many decades of work on optimizing query processing in database management systems. Recently, modern machine learning (ML), and specifically reinforcement learning (RL), has gained increased attention as a means to develop a query optimizer (QO). In this work, we take a closer look at two recent state-of-the-art (SOTA) RL-based QO methods to better understand their behavior. We find that these RL-based methods do not generalize as well as it seems at first glance. Thus, we ask a simple question: How do SOTA RL-based QOs compare to a simple, modern, adaptive query processing approach? To answer this question, we choose two simple adaptive query processing techniques and implemented them in PostgreSQL. The first adapts an individual join operation on-the-fly and switches between a Nested Loop Join algorithm and a Hash Join algorithm to avoid sub-optimal join algorithm decisions. The second is a technique called Lookahead Information Passing (LIP), in which adaptive semijoin techniques are used to make a pipeline of join operations execute efficiently. To our surprise, we find that this simple adaptive query processing approach is not only competitive to the SOTA RL-based approaches but, in some cases, outperforms the RL-based approaches. The adaptive approach is also appealing because it does not require an expensive training step, and it is fully interpretable compared to the RL-based QO approaches. Further, the adaptive method works across complex query constructs that RL-based QO methods currently cannot optimize.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 8 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- λ-Tune: Harnessing Large Language Models for Automated Database System Tuning 引用了 Balsa: Learning a Query Optimizer Without Expert Demonstrations
- λ-Tune: Harnessing Large Language Models for Automated Database System Tuning 引用了 Bao: Making Learned Query Optimization Practical
- Astrid: Accurate Selectivity Estimation for String Predicates using Deep Learning 引用了 An End-to-End Learning-based Cost Estimator
- Robust Predicate Transfer with Dynamic Execution 引用了 Parachute: Single-Pass Bi-Directional Information Passing
- Robust Predicate Transfer with Dynamic Execution 引用了 Is Your Learned Query Optimizer Behaving As You Expect? A Machine Learning Perspective
- Balsa: Learning a Query Optimizer Without Expert Demonstrations 引用了 Astrid: Accurate Selectivity Estimation for String Predicates using Deep Learning
- Balsa: Learning a Query Optimizer Without Expert Demonstrations 引用了 An End-to-End Learning-based Cost Estimator
- Balsa: Learning a Query Optimizer Without Expert Demonstrations 引用了 Bao: Making Learned Query Optimization Practical
- Is Your Learned Query Optimizer Behaving As You Expect? A Machine Learning Perspective 引用了 Balsa: Learning a Query Optimizer Without Expert Demonstrations
- Is Your Learned Query Optimizer Behaving As You Expect? A Machine Learning Perspective 引用了 Bao: Making Learned Query Optimization Practical
- Bao: Making Learned Query Optimization Practical 引用了 An End-to-End Learning-based Cost Estimator
引用它的顶会 Paper8
- λ-Tune: Harnessing Large Language Models for Automated Database System TuningVictor Giannakouris, Immanuel TrummerSIGMOD 2025 · 20 次引用
- Is Your Learned Query Optimizer Behaving As You Expect? A Machine Learning PerspectiveClaude Lehmann, Pavel Sulimov, Kurt StockingerVLDB 2024 · 17 次引用
- Parachute: Single-Pass Bi-Directional Information PassingMihail Stoian, Andreas Zimmerer, Skander Krid, Amadou Ngom 等VLDB 2025 · 6 次引用
- Optimizing Queries with Many-to-Many JoinsHasara Kalumin, Amol DeshpandeICDE 2025 · 3 次引用
- Robust Predicate Transfer with Dynamic ExecutionYiming Qiao, Peter Boncz, Huanchen ZhangVLDB 2026 · 2 次引用
它引用的 Paper6
- An End-to-End Learning-based Cost EstimatorJi Sun, Guoliang LiVLDB 2020 · 251 次引用
- Bao: Making Learned Query Optimization PracticalRyan Marcus, Parimarjan Negi, Hongzi Mao, Nesime Tatbul 等SIGMOD 2021 · 242 次引用
- Balsa: Learning a Query Optimizer Without Expert DemonstrationsZongheng Yang, Wei-Lin Chiang, Sifei Luan, Gautam Mittal 等SIGMOD 2022 · 99 次引用
- Pushing Data-Induced Predicates Through Joins in Big-Data ClustersLaurel J. Orr, Srikanth Kandula, Surajit ChaudhuriVLDB 2020 · 35 次引用
- Astrid: Accurate Selectivity Estimation for String Predicates using Deep LearningSuraj Shetiya, Saravanan Thirumuruganathan, Nick Koudas, Gautam DasVLDB 2021 · 31 次引用
相关 Paper
- ADOPT: Adaptively Optimizing Attribute Orders for Worst-Case Optimal Join Algorithms via Reinforcement LearningJunxiong Wang, Immanuel Trummer, Ahmet Kara, Dan OlteanuVLDB 2023 · 10 次引用
- GenJoin: Conditional Generative Plan-to-Plan Query Optimizer that Learns from Subplan HintsPavel Sulimov, Claude Lehmann, Kurt StockingerSIGMOD 2026 · 3 次引用
- LOGER: A Learned Optimizer towards Generating Efficient and Robust Query Execution PlansTianyi Chen, Jun Gao, Hedui Chen, Yaofeng TuVLDB 2023 · 54 次引用
- Lero: A Learning-to-Rank Query OptimizerRong Zhu, Wei Chen, Bolin Ding, Xingguang Chen 等VLDB 2023 · 102 次引用
- Reinforcement Learning with Tree-LSTM for Join Order SelectionXiang Yu, Guoliang Li, Chengliang Chai, Nan TangICDE 2020 · 168 次引用
