Litcius/Paper detail

QueryFormer

Yue Zhao, Gao Cong, Jiachen Shi, Chunyan Miao

2022Proceedings of the VLDB Endowment98 citationsDOI

Abstract

Machine learning has become a prominent method in many database optimization problems such as cost estimation, index selection and query optimization. Translating query execution plans into their vectorized representations is non-trivial. Recently, several query plan representation methods have been proposed. However, they have two limitations. First, they do not fully utilize readily available database statistics in the representation, which characterizes the data distribution. Second, they typically have difficulty in modeling long paths of information flow in a query plan, and capturing parent-children dependency between operators. To tackle these limitations, we propose QueryFormer, a learning-based query plan representation model with a tree-structured Transformer architecture. In particular, we propose a novel scheme to integrate histograms obtained from database systems into query plan encoding. In addition, to effectively capture the information flow following the tree structure of a query plan, we develop a tree-structured model with the attention mechanism. We integrate QueryFormer into four machine learning models, each for a database optimization task, and experimental results show that QueryFormer is able to improve performance of these models significantly.

Topics & Concepts

Computer scienceQuery optimizationSargableData miningQuery languageQuery planViewRepresentation (politics)Query expansionMachine learningInformation retrievalArtificial intelligenceWeb search queryDatabase designSearch enginePolitical sciencePoliticsLawData Management and AlgorithmsAdvanced Database Systems and QueriesData Stream Mining Techniques