arrow
Return

Presto's History-based Query Optimizer

delete2024-11-08
delete0
PRE
AI
P
Pranjal Shankhdhar *
S
Sun, James
L
Liu, Feilong
S
Schlussel, Rebecca
N
Narale, Jay
L
Lyublena Antova
DOI:10.14778/3685800.3685828delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
An important feature of modern query optimizers is the ability to produce a query plan that is optimal for the underlying data set. This requires the ability to estimate cardinalities and computational costs of intermediate query plan nodes, which is highly dependent on both the query shape and the underlying data distribution. Traditional methods include collecting statistics on base tables and implementing cardinality and computational cost derivation inside the optimizer, which is error-prone for complex query shapes. This paper presents Presto's novel history-based optimization framework (HBO), which collects execution histories and uses them to optimize similar queries in the future. The framework produces accurate estimates for complex query shapes in a lightweight, automated manner, and adapts automatically to changes in underlying data distributions. We present the design and implementation of the HBO framework and provide details on its use in various optimization rules, as well as details on implementing the statistics store on top of a Redis key-value store. We also present the results of running HBO in production in two large data infrastructure organizations (Meta and Uber).
Keywords:
SQL

Journal

P
Proceedings of the VLDB Endowment
IF:
3.3
Papers:
556
Citations:
1.2W

Organization

U
uber technol
Scholars:
1
Papers: 1
Citations: 0
M
meta platforms
Scholars:
10
Papers: 6
Citations: 0