arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2204.05529cs.DBcs.AI
收藏

预测Twitter上的SQL查询成本

Forecasting SQL Query Cost at Twitter

Twitter, Inc.(推特公司)
Chunxu Tang, Beinan Wang, Zhenxiao Luo, Huijun Wu, Shajan Dasan, Maosong Fu, Yao Li, Mainak Ghosh, Ruchin Kabra, Nikhil Kantibhai Navadiya, Da Cheng, Fred Dai, … 展开作者

Chunxu Tang, Beinan Wang, Zhenxiao Luo, Huijun Wu, Shajan Dasan, Maosong Fu, Yao Li, Mainak Ghosh, Ruchin Kabra, Nikhil Kantibhai Navadiya, Da Cheng, Fred Dai, Vrushali Channapattan, Prachi Mishra

摘要:

随着大数据时代的到来,使用传统的DBMS方法来计算SQL查询的资源使用量通常是计算昂贵的。我们是否可以更有效地估计每个查询的成本,而无需在SQL引擎内核中进行任何计算?机器学习技术能否帮助估计SQL查询资源利用率?答案是肯定的。我们提出了一个SQL查询成本预测服务,它采用机器学习技术,训练模型,从历史查询请求日志和快速预测的CPU和内存资源的使用,而无需在SQL引擎中进行任何计算。在Twitter,基础设施工程师正在维护一个跨本地和云数据中心的大规模SQL联合系统,以服务于临时查询。建议的服务可以通过缓解SQL引擎集群中不平衡的在线分析处理(OLAP)工作负载的问题来帮助改善查询调度。它还可以帮助实现抢先扩展。此外,所提出的方法使用普通SQL语句进行模型训练和在线预测,这表明它与硬件和软件无关。该方法可以推广到更广泛的SQL系统和异构环境。该模型对CPU使用率的预测精度达到97.9%,对内存使用率的预测精度达到97%.

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑