PreQR: Pre-training Representation for SQL Understanding
Xiu Tang, Sai Wu, Mingli Song, Shanshan Ying, Feifei Li, Gang Chen
Abstract
Recently, the learning-based models are shown to outperform the conventional methods for many database tasks such as cardinality estimation, join order selection and performance tuning. However, most existing learning-based methods adopt the one-hot encoding for SQL query representation, unable to catch complicated semantic context, e.g. structure of query, database schema definition and distribution variance of columns. To address such above problem, we propose a novel pre-trained SQL representation model, called PreQR, which extends the language representation approach to SQL queries. We propose an automaton to encode the query structures, and apply a graph neural network to encode database schema information conditioned on the query. A new SQL encoder is then established by adopting the attention mechanism to support on-the-fly query-aware schema linking. Experimental results on real datasets show that replacing the one-hot encoding with our query representation can significantly improve the performances of existing learning-based models on several database tasks.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get 07bcf0cc-82f5-4b14-898d-943c6840db20Cited by top-tier papers4
- GPTuner: A Manual-Reading Database Tuning System via GPT-Guided Bayesian OptimizationJiale Lao, Yibo Wang, Yufei Li, Jianping Wang et al.VLDB 2024 · 76 citations
- SQL-Factory: A Multi-Agent Framework for High-Quality and Large-Scale SQL GenerationJiahui Li, Tongwang Wu, Yuren Mao, Yunjun Gao et al.VLDB 2026 · 7 citations
- RCRank: Multimodal Ranking of Root Causes of Slow Queries in Cloud Database SystemsBiao Ouyang, Yingying Zhang, Hanyin Cheng, Yang Shu et al.VLDB 2025 · 7 citations
- SSIN: Self-Supervised Learning for Rainfall Spatial InterpolationJia Li, Yanyan Shen, Lei Chen, Charles Wang Wai NgSIGMOD 2023 · 6 citations
Related papers
- QueryFormer: A Tree Transformer Model for Query Plan RepresentationYue Zhao, Gao Cong, Jiachen Shi, Chunyan MiaoVLDB 2022 · 117 citations
- LORE: Learning-Based Resource Recommendation for Big Data QueriesYan Li, Liwei Wang, Bolong Zheng, Zhiyong PengICDE 2025 · 2 citations
- Learning Contextual Representations for Semantic Parsing with Generation-Augmented Pre-TrainingPeng Shi, Patrick Ng, Zhiguo Wang, Henghui Zhu et al.AAAI 2021 · 124 citations
- Sample-Efficient Cardinality Estimation Using Geometric Deep LearningSilvan Reiner, Michael GrossniklausVLDB 2024 · 20 citations
- RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL ParsersBailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov et al.ACL 2020 · 39 citations
