Improving DBMS Scheduling Decisions with Accurate Performance Prediction on Concurrent Queries

Ziniu Wu, Markos Markakis, Chunwei Liu, Peter Baile Chen, Balakrishnan Narayanaswamy, Tim Kraska, Samuel MaddenPVLDB 2025

TL;DR

This paper introduces IconqSched, a novel non-intrusive database scheduler that significantly improves query performance by accurately predicting the runtime of concurrent queries. By treating the database as a black box and using a bi-directional LSTM-based predictor (Iconq), IconqSched makes smarter decisions about when to execute queries, leading to substantial reductions in end-to-end query times.

What Problem Does This Paper Address?

Database Management Systems (DBMS) face a critical challenge in efficiently scheduling concurrent queries. The performance of a query is not just its own execution time but also the time it spends waiting in a queue. Existing schedulers often rely on simplified models or heuristics that fail to accurately capture the complex interactions between concurrent queries and the dynamic state of the DBMS (e.g., resource utilization, cache status). This leads to suboptimal scheduling decisions, resulting in increased query latency and reduced overall system throughput. While deeply integrated schedulers can offer better performance, they require significant DBMS modifications and are engine-specific. Non-intrusive schedulers, which operate externally, are more flexible but often lack the predictive power to make truly informed decisions.

Methods

The core of this work lies in two main components:

  • Iconq (Interaction of Concurrent Queries) Predictor: This is a novel, fine-grained predictor that treats the DBMS as a black box. It uses a bi-directional Long Short-Term Memory (LSTM) network to model complex query interactions and system state changes.
  • Query Featurization: Each query is represented by a feature vector capturing its execution plan characteristics and the tables it accesses.
  • Interaction Feature Vectors: For concurrent queries, interaction feature vectors are created, combining query features and timestamp differences to capture their temporal relationships and potential overlaps.
  • Bi-directional LSTM: This architecture processes the interaction features in both forward and backward directions. The forward pass models the impact of preceding queries on the target query, while the backward pass models the impact of the target query on subsequent queries. This allows for a more comprehensive understanding of concurrency effects.
  • IconqSched (Scheduler): This is a lightweight, non-intrusive scheduling layer that sits outside the DBMS.
  • Greedy Scheduling Algorithm: IconqSched uses Iconq's predictions to make scheduling decisions. It employs a greedy approach to select candidate queries from a waiting queue and determine the optimal submission time. This algorithm iteratively scores potential queries based on their predicted impact on overall end-to-end runtime, considering both their own performance and their effect on currently running queries.
  • Event-Driven Invocation: The scheduler is invoked not on a fixed timer but in response to events like query arrivals or query completions, making it more responsive and efficient.
  • Short Query Optimization: Queries with very short predicted runtimes are submitted immediately to avoid unnecessary scheduling overhead.

Datasets

The paper uses two primary datasets for evaluation:

  • CAB (Cloud Analytic Benchmark): This benchmark is based on TPC-H query templates but uses real customer query traces from Snowflake. It aims to mimic cloud data warehouse workloads.
  • BRAD (Benchmark for Realistic Analytical Data): This benchmark uses a real-world dataset (IMDB) scaled to 160GB and generates analytical queries that resemble those found in real-world scenarios. The query submission times are derived from Snowflake traces to match practical workload patterns.

Both datasets were used for training, validation, and testing of the proposed scheduler and its baselines.

Key Insights and Ideas

  • The Power of Black-Box Prediction: IconqSched demonstrates that accurate performance prediction is possible without needing to understand the internal workings of a DBMS. This makes the approach highly portable across different database systems.
  • Bi-directional LSTM for Concurrency: The bi-directional LSTM architecture is crucial for capturing the two-way impact of concurrent queries: how past queries affect the current one, and how the current query will affect future ones. This is a significant advancement over unidirectional models.
  • Greedy Scheduling with Predictive Scoring: A simple greedy approach, guided by sophisticated runtime predictions, can effectively approximate optimal scheduling decisions for complex, NP-hard problems.
  • Short-Running Queries are Different: The observation that short-running queries are less sensitive to scheduling and can be submitted directly highlights a practical optimization for reducing overhead.
  • Beyond Average Performance: The paper emphasizes the importance of improving not just average but also tail latencies (e.g., p90, p95), which are critical for user experience in many applications.

Key Results

  • PostgreSQL: IconqSched achieved significant end-to-end runtime improvements:
  • CAB workload: 16.2% average, 18.5% median, and 23.8% tail improvement over the default scheduler.
  • BRAD workload: 16.2% average and 33.6% tail improvement.
  • Redshift: Despite Redshift having a more sophisticated built-in workload manager, IconqSched still provided improvements:
  • CAB workload: 14.4% average and 22.9% tail improvement.
  • BRAD workload: 10.3% average and 14.9% tail improvement.
  • Iconq Predictor Accuracy: Iconq demonstrated superior prediction accuracy compared to baselines like Stage, Function, and GPredictor, with 1.5x-2.4x better median Q-error and 2.4x-4.9x better tail Q-error.
  • Generalizability: Iconq showed strong robustness and generalizability to heavier concurrency states and more complex query templates, outperforming other methods.

Limitations and Future Work

  • Cold-Start Problem: IconqSched requires a period of query execution history for training. Addressing this "cold-start" problem for new instances is identified as future work.
  • Serverless/Multi-tenant Environments: The current model assumes fixed hardware. Predicting performance in dynamic serverless or multi-tenant environments, where resource availability can fluctuate unpredictably, is noted as a limitation and an area for future research.
  • Optimizing Tail Latency: While the paper reports tail latency improvements, explicitly optimizing for median or tail runtime through modifications to the scoring function is suggested for future exploration.
  • More Complex Workloads: The paper acknowledges that the CAB workload's queries are generated from templates and may lack the complex data distributions of real-world datasets, which is why the BRAD workload was also used.
  • Ablation Study Insights: An ablation study showed that using a less accurate predictor like GPredictor with IconqSched's scheduling logic resulted in worse performance than the default DBMS scheduler, highlighting the critical role of Iconq's predictive accuracy.

Summary updated

BibTeX
@article{wu2025improving,
  author = {Ziniu Wu and Markos Markakis and Chunwei Liu and Peter Baile Chen and Balakrishnan Narayanaswamy and Tim Kraska and Samuel Madden},
  title = {{Improving DBMS Scheduling Decisions with Accurate Performance Prediction on Concurrent Queries}},
  journal = {Proc. VLDB Endow.},
  year = {2025},
  doi = {10.14778/3749646.3749686},
}
Figure