Back to search

Nanyang Technological University

Leveraging AI technology for query optimizers in database systems

Abstract

dc:description.abstract

Query optimization is a long-standing and fundamental problem in database systems. With the growing complexity and scale of modern applications, traditional optimizers, largely based on rule-based heuristics and cost estimation models, struggle to adapt to emerging challenges such as concurrent query workloads, partitioned data storage, and parameterized execution. These challenges introduce optimization needs that go beyond single-query scenarios and require new techniques to ensure efficient plan generation, reuse, and selection across diverse environments. This dissertation explores a learning-based approach to address query optimization across four representative and practically important scenarios: (1) concurrent query optimization under real-time execution, (2) join optimization over partitioned tables, (3) parametric query optimization (PQO) with dynamic parameter bindings, and (4) scalable and adaptive PQO deployment in industrial settings. For each scenario, we identify core challenges and design corresponding machine learning solutions that improve plan quality, reduce overhead, and adapt to workload changes. In the first part, we focus on real-time multi-query optimization in systems using tuple-at-a-time execution engines. These engines, widely adopted in commercial databases, pose unique challenges for result reuse and concurrent plan construction. We propose Lemo, a transformer-based learning-to-plan framework that captures the redundancy across concurrent queries and dynamically reuses intermediate results through a shared buffer. By jointly modeling reuse and latency trade-offs, Lemo significantly improves throughput and response time in concurrent workloads. In the second part, we study join optimization in partitioned tables, a common structure in modern database systems. Traditional partition pruning techniques rely on range indexes and static rules, which cannot effectively handle non-numeric keys or query predicates. We develop a binary classification model to predict join feasibility between sub-tables, enabling fine-grained pruning. To tackle the exponential plan search space, we design a pruning-and-ranking framework that selects high-pruning join orders and generates efficient partition-aware plans guided by a learned scoring model. In the third part, we address the challenges of parametric query optimization. PQO aims to precompute a set of high-quality plans and select the best one at runtime, avoiding the overhead of re-optimization for each parameter. We propose a hybrid enumeration strategy that perturbs both join orders and predicate selectivities to cover diverse plan regions. A learning-to-rank model is trained to compare plans and select the optimal one based on the parameter vector, improving runtime decision quality while reducing plan caching overhead. In the final part, we address two practical issues in scaling PQO to real-world deployments: how to support thousands of query templates without maintaining one model per template, and how to adapt to parameter distribution drift over time. We develop a hierarchical clustering mechanism that groups templates based on learned embeddings and shares models within each group. In addition, we introduce a lightweight KL-divergence-based drift detector that triggers online model fine-tuning and plan set refreshing when the parameter distribution shifts. Together, these contributions present a holistic learning-based framework for query optimization that spans from real-time optimization to scalable industrial deployment. Our methods are evaluated on both academic benchmarks and production workloads, demonstrating significant improvements in plan quality, latency, and adaptability over traditional approaches.

Degree

thesis:*
College dc:contributor.school
College of Computing and Data Science
Grantor dc:publisher
Nanyang Technological University
Year dc:date.issued
2025

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Mo, Songsong
Advisor dc:contributor.supervisor
  • Gao Cong

Subjects

dc:subject × 1

Rights

dc:rights
Statement dc:rights
  • This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).
Language dc:language.iso
en

Identifiers

dc:identifier.*

Chain of custody

source
Harvested from
Nanyang Technological University
Base URL
dr.ntu.edu.sg/oai/request
Last updated
2026-11-28
Source record
OAI-PMH GetRecord
citation

Mo, Songsong. Leveraging AI technology for query optimizers in database systems. Nanyang Technological University, 2025. https://doi.org/10.32657/10356/210450