Forecasting SQL Query Cost at Twitter

04/12/2022
by   Chunxu Tang, et al.
4

With the advent of the Big Data era, it is usually computationally expensive to calculate the resource usages of a SQL query with traditional DBMS approaches. Can we estimate the cost of each query more efficiently without any computation in a SQL engine kernel? Can machine learning techniques help to estimate SQL query resource utilization? The answers are yes. We propose a SQL query cost predictor service, which employs machine learning techniques to train models from historical query request logs and rapidly forecasts the CPU and memory resource usages of online queries without any computation in a SQL engine. At Twitter, infrastructure engineers are maintaining a large-scale SQL federation system across on-premises and cloud data centers for serving ad-hoc queries. The proposed service can help to improve query scheduling by relieving the issue of imbalanced online analytical processing (OLAP) workloads in the SQL engine clusters. It can also assist in enabling preemptive scaling. Additionally, the proposed approach uses plain SQL statements for the model training and online prediction, indicating it is both hardware and software-agnostic. The method can be generalized to broader SQL systems and heterogeneous environments. The models can achieve 97.9% accuracy for CPU usage prediction and 97% accuracy for memory usage prediction.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/09/2022

Serving Hybrid-Cloud SQL Interactive Queries at Twitter

The demand for data analytics has been consistently increasing in the pa...
research
02/21/2020

Facilitating SQL Query Composition and Analysis

Formulating efficient SQL queries requires several cycles of tuning and ...
research
07/06/2020

Characterizing BigBench queries, Hive, and Spark in multi-cloud environments

BigBench is the new standard (TPCx-BB) for benchmarking and testing Big ...
research
05/17/2022

Journey of Migrating Millions of Queries on The Cloud

Treasure Data is processing millions of distributed SQL queries every da...
research
10/12/2020

PolyFrame: A Retargetable Query-based Approach to Scaling DataFrames (Extended Version)

In the last few years, the field of data science has been growing rapidl...
research
03/03/2022

Query Processing on Tensor Computation Runtimes

The huge demand for computation in artificial intelligence (AI) is drivi...
research
11/30/2021

Maliva: Using Machine Learning to Rewrite Visualization Queries Under Time Constraints

We consider data-visualization systems where a middleware layer translat...

Please sign up or login with your details

Forgot password? Click here to reset