Lune

VLDB2025Top-tier venue

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 Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • OBELISK: Efficient Offline Query Planning with Bayesian Optimization-Informed Language Model Reasoning cites Flow-Loss: Learning Cardinality Estimates That Matter
  • ReSequel: Robust LLM-assisted Query Rewriting and Optimization using Templatization and Sampling cites Flow-Loss: Learning Cardinality Estimates That Matter
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. OBELISK: Efficient Offline Query Planning with Bayesian Optimization-Informed Language Model ReasoningZhicheng Pan, Wenwen Sun, Yuanjia Zhang, Terence Purcell et al.VLDB 2026
  2. ReSequel: Robust LLM-assisted Query Rewriting and Optimization using Templatization and SamplingSaeed Fathollahzadeh, Essam Mansour, Matthias BoehmVLDB 2026

Builds on2

  1. Flow-Loss: Learning Cardinality Estimates That MatterParimarjan Negi, Ryan Marcus, Andreas Kipf, Hongzi Mao et al.VLDB 2021 · 102 citations
  2. Efficiently Computing Join Orders with Heuristic SearchImmanuel Haffner, Jens DittrichSIGMOD 2023 · 8 citations

Related papers

  1. 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
  2. Efficient Query Re-optimization with Judicious Subquery SelectionsJunyi Zhao, Huanchen Zhang, Yihan GaoSIGMOD 2023 · 12 citations
  3. Adopting Worst-Case Optimal Joins in Relational Database SystemsMichael J. Freitag, Maximilian Bandle, Tobias Schmidt, Alfons Kemper et al.VLDB 2020 · 79 citations
  4. Hybrid Mixed Integer Linear Programming for Large-Scale Join Order OptimisationManuel Schönberger, Immanuel Trummer, Wolfgang MauererVLDB 2026
  5. Rethink Query Optimization in HTAP DatabasesHaoze Song, Wenchao Zhou, Feifei Li, Xiang Peng et al.SIGMOD 2024 · 7 citations
Dusk over the sea between two cliffs drawn in fine vertical lines