Table of Contents
Fetching ...

LearnedWMP: Workload Memory Prediction Using Distribution of Query Templates

Shaikh Quader, Andres Jaramillo, Sumona Mukhopadhyay, Ghadeer Abuoda, Calisto Zuzarte, David Kalmuk, Marin Litoiu, Manos Papagelis

TL;DR

This paper tackles the memory bottleneck in in-memory DBMS workloads by predicting the memory demand of a batch of queries rather than estimating each query individually. It reframes workload memory prediction as a distribution regression problem over histograms of learned query templates, enabling efficient, workload-level estimates. The LearnedWMP pipeline learns templates from query plans, builds workload histograms, and trains a regression model to map histograms to memory usage, achieving up to a 47.6% reduction in estimation error and 3–10x faster training and inference compared to single-query baselines, with substantially smaller model sizes. The approach demonstrates strong accuracy and practicality across benchmarks (TPC-DS, JOB, TPC-C) and offers a viable pathway for integration into real DBMS memory management and admission control systems.

Abstract

In a modern DBMS, working memory is frequently the limiting factor when processing in-memory analytic query operations such as joins, sorting, and aggregation. Existing resource estimation approaches for a DBMS estimate the resource consumption of a query by computing an estimate of each individual database operator in the query execution plan. Such an approach is slow and error-prone as it relies upon simplifying assumptions, such as uniformity and independence of the underlying data. Additionally, the existing approach focuses on individual queries separately and does not factor in other queries in the workload that may be executed concurrently. In this research, we are interested in query performance optimization under concurrent execution of a batch of queries (a workload). Specifically, we focus on predicting the memory demand for a workload rather than providing separate estimates for each query within it. We introduce the problem of workload memory prediction and formalize it as a distribution regression problem. We propose Learned Workload Memory Prediction (LearnedWMP) to improve and simplify estimating the working memory demands of workloads. Through a comprehensive experimental evaluation, we show that LearnedWMP reduces the memory estimation error of the state-of-the-practice method by up to 47.6%. Compared to an alternative single-query model, during training and inferencing, the LearnedWMP model and its variants were 3x to 10x faster. Moreover, LearnedWMP-based models were at least 50% smaller in most cases. Overall, the results demonstrate the advantages of the LearnedWMP approach and its potential for a broader impact on query performance optimization.

LearnedWMP: Workload Memory Prediction Using Distribution of Query Templates

TL;DR

This paper tackles the memory bottleneck in in-memory DBMS workloads by predicting the memory demand of a batch of queries rather than estimating each query individually. It reframes workload memory prediction as a distribution regression problem over histograms of learned query templates, enabling efficient, workload-level estimates. The LearnedWMP pipeline learns templates from query plans, builds workload histograms, and trains a regression model to map histograms to memory usage, achieving up to a 47.6% reduction in estimation error and 3–10x faster training and inference compared to single-query baselines, with substantially smaller model sizes. The approach demonstrates strong accuracy and practicality across benchmarks (TPC-DS, JOB, TPC-C) and offers a viable pathway for integration into real DBMS memory management and admission control systems.

Abstract

In a modern DBMS, working memory is frequently the limiting factor when processing in-memory analytic query operations such as joins, sorting, and aggregation. Existing resource estimation approaches for a DBMS estimate the resource consumption of a query by computing an estimate of each individual database operator in the query execution plan. Such an approach is slow and error-prone as it relies upon simplifying assumptions, such as uniformity and independence of the underlying data. Additionally, the existing approach focuses on individual queries separately and does not factor in other queries in the workload that may be executed concurrently. In this research, we are interested in query performance optimization under concurrent execution of a batch of queries (a workload). Specifically, we focus on predicting the memory demand for a workload rather than providing separate estimates for each query within it. We introduce the problem of workload memory prediction and formalize it as a distribution regression problem. We propose Learned Workload Memory Prediction (LearnedWMP) to improve and simplify estimating the working memory demands of workloads. Through a comprehensive experimental evaluation, we show that LearnedWMP reduces the memory estimation error of the state-of-the-practice method by up to 47.6%. Compared to an alternative single-query model, during training and inferencing, the LearnedWMP model and its variants were 3x to 10x faster. Moreover, LearnedWMP-based models were at least 50% smaller in most cases. Overall, the results demonstrate the advantages of the LearnedWMP approach and its potential for a broader impact on query performance optimization.
Paper Structure (16 sections, 10 equations, 10 figures, 1 table, 3 algorithms)

This paper contains 16 sections, 10 equations, 10 figures, 1 table, 3 algorithms.

Figures (10)

  • Figure 1: Overview of the LearnedWMP model. Left: Users send queries to a DBMS; the DBMS processes and sends responses to the queries. Right-upper: the training steps of the LearnedWMP model. Right-bottom: the steps of the inference stage.
  • Figure 2: Extracting query features from a query. An example query (top) is executed by the query plan (left), leading to the extraction of the query features (right). The query features are used to learn a set of query templates $\mathcal{T}$, of size $k$.
  • Figure 3: An example of generating a histogram $\mathcal{H}$ from a training workload $w=(\mathcal{Q}, y)$, where $|\mathcal{Q}|=9$ and $k=4$.
  • Figure 5: Estimation Error Residuals Distributions
  • Figure 6: ML model training time
  • ...and 5 more figures