How to Optimize SQL Queries? A Comparison Between Split, Holistic, and Hybrid Approaches
Luca Gretscher, Jens Dittrich
Abstract
Relational database systems internally construct a physical query execution plan (QEP) that specifies exactly how to compute a desired result. However, choosing a QEP involves determining a specific join order, deciding how to access base relations, specifying concrete physical implementations to compute the algebraic operations defined by the given SQL query, and much more. In general, choosing the optimal QEP w.r.t. a predefined cost model is a hard optimization task, referred to as query optimization problem (QOP), that requires super-exponential time in the worst-case.
Even though query optimization is a fundamental problem that has been studied for decades now, related work often focuses only on a specific subtask like join ordering. Furthermore, by inspecting open-source database systems, fundamentally different query optimization strategies can be observed. These strategies exhibit vastly different optimization times while having a major impact on the resulting QEP qualities. In this work, we revisit two conceptually different approaches to solve query optimization, namely split and holistic. We discuss their advantages and disadvantages and present a detailed experimental evaluation in our research database system mu t able. Additionally, we propose a hybrid strategy called top-k that is able to rediscover the holistically optimal QEPs while being significantly closer to the optimization time of split.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext c9310122-e264-4211-9e09-297e28d740e0Cited by top-tier papers2
- OBELISK: Efficient Offline Query Planning with Bayesian Optimization-Informed Language Model ReasoningZhicheng Pan, Wenwen Sun, Yuanjia Zhang, Terence Purcell et al.VLDB 2026
- ReSequel: Robust LLM-assisted Query Rewriting and Optimization using Templatization and SamplingSaeed Fathollahzadeh, Essam Mansour, Matthias BoehmVLDB 2026
Builds on2
Related papers
- How Good are Learned Cost Models, Really? Insights from Query Optimization TasksRoman Heinrich, Manisha Luthra, Johannes Wehrstein, Harald Kornmayer et al.SIGMOD 2025 · 13 citations
- Efficient Query Re-optimization with Judicious Subquery SelectionsJunyi Zhao, Huanchen Zhang, Yihan GaoSIGMOD 2023 · 12 citations
- Adopting Worst-Case Optimal Joins in Relational Database SystemsMichael J. Freitag, Maximilian Bandle, Tobias Schmidt, Alfons Kemper et al.VLDB 2020 · 79 citations
- Hybrid Mixed Integer Linear Programming for Large-Scale Join Order OptimisationManuel Schönberger, Immanuel Trummer, Wolfgang MauererVLDB 2026
- Rethink Query Optimization in HTAP DatabasesHaoze Song, Wenchao Zhou, Feifei Li, Xiang Peng et al.SIGMOD 2024 · 7 citations
