Contender: A Resource Modeling Approach for Concurrent Query Performance Prediction

Jennie Duggan, Olga Papaemmanouil, Ugur Çetintemel, Eli UpfalEDBT 2014

Introduction

In modern data warehouses, queries rarely run in isolation. They compete for shared hardware resources—primarily I/O bandwidth and memory. This competition makes predicting query latency incredibly difficult. A query might speed up due to shared table scans (positive interaction) or stall behind an I/O-heavy "spoiler" query (negative interaction).

Existing Concurrent Query Performance Prediction (CQPP) models typically rely on "black-box" machine learning. These models require massive amounts of training data and often fail when encountering new query templates ("ad-hoc" queries) without extensive retraining. Contender is a resource-aware framework designed to overcome these hurdles by modeling hardware contention directly.

Methodology: Resource-Aware Modeling

Contender shifts the focus from query plan patterns to resource modeling. Its approach is built on three pillars:

  1. The Performance Continuum: Every query has a range of possible latencies, from isolated execution (lower bound) to "spoiler latency" under extreme contention (upper bound).
  2. Concurrent Query Intensity (CQI): This metric quantifies the execution environment by calculating how aggressively concurrent queries utilize the I/O bus, accounting for positive interactions like shared sequential scans.
  3. Query Sensitivity (QS): A linear model that maps the CQI of a specific mix to a point on the query's performance continuum.
The Contender workflow for predicting the performance of new query templates in concurrent mixes.

To handle unseen queries, Contender uses a k-Nearest Neighbors (KNN) approach. By analyzing a new query's isolated behavior (e.g., I/O-to-CPU ratio), it identifies similar known queries and adapts their sensitivity models to predict performance under contention.

Key Insights: Linearity and Similarity

The effectiveness of Contender rests on two critical observations:

  • Linearity of Contention: There is a strong linear relationship between resource intensity (CQI) and a query's position on its performance continuum. This simplicity allows for accurate predictions with minimal sampling.
  • Predictable Similarity: Queries with similar resource profiles in isolation tend to react to contention in similar ways.
Empirical evidence showing the strong correlation ($R^2 = 0.82$) between model parameters, supporting the use of similarity-based prediction.

This insight allows Contender to move from polynomial training time (relative to the number of templates) to linear time for known templates and near-constant time for new ones.

Evaluation and Results

The researchers evaluated Contender using the TPC-DS benchmark (100 GB) on PostgreSQL. The workload included 25 distinct query templates with isolated latencies between 130 and 1,000 seconds. Training mixes were selected using Latin Hypercube Sampling (LHS) across Multiprogramming Levels (MPL) 2 through 5.

Key Performance Metrics: * Accuracy: Contender achieved a mean relative error of 19% for known templates and 25% for brand-new templates. * Efficiency: For new templates, Contender reduced training requirements from over 100 hours (for traditional ML) to just a few minutes of isolated profiling. * Comparison: Standard ML techniques like SVMs and KCCA struggled significantly with unseen templates, often producing much higher errors, whereas Contender remained robust.

Limitations and Future Work

While highly effective, Contender has some limitations. In approximately 4% of cases, observed latency exceeded the predicted "worst-case" spoiler latency, typically due to overhead from many short queries. Future work aims to:

  • Increase granularity by modeling at the query plan node level.
  • Extend the model to distributed environments to account for network latency.
  • Address write-heavy workloads (OLTP) by modeling lock and buffer contention.

Summary updated

BibTeX
@inproceedings{duggan2014contender,
  author = {Jennie Duggan and Olga Papaemmanouil and Ugur Çetintemel and Eli Upfal},
  title = {{Contender: A Resource Modeling Approach for Concurrent Query Performance Prediction}},
  booktitle = {EDBT},
  year = {2014},
  doi = {10.5441/002/edbt.2014.11},
}
Figure