LLM-R2: A Large Language Model Enhanced Rule-based Rewrite System for Boosting Query Efficiency
Zhaodonghui Li, Haitao Yuan, Huiming Wang, Gao Cong, Lidong Bing
摘要
Query rewrite, which aims to improve query efficiency by altering an SQL query's structure without changing its result, has been an important research problem. In order to maintain equivalence between the rewritten query and the original one during rewriting, traditional query rewrite methods always rewrite the queries following certain rewrite rules. However, some problems still remain. First, existing methods of finding the optimal choice or sequence of rewrite rules are still limited and the process always costs a lot of resources. Methods involving discovering new rewrite rules typically require complicated proofs of structural logic or extensive user interactions. Second, current query rewrite methods usually rely highly on DBMS cost estimators which are often not accurate. In this paper, we address these problems by proposing a novel query rewrite method named LLM-R 2 , which leverages a large language model (LLM) to recommend rewrite rules for a database rewrite system. To further enhance the inference ability of the LLM in recommending rewrite rules, we train a contrastive model using a curriculum-based approach to learn query representations and select effective query demonstrations for the LLM. Experimental results show that our method significantly improves the query execution efficiency and outperforms the baseline methods. In addition, our method exhibits high robustness across different datasets.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper22
- In-depth Analysis of Graph-based RAG in a Unified FrameworkYingli Zhou, Yaodong Su, Youran Sun, Shu Wang 等VLDB 2025 · 被引用 48 次
- GenRewrite: Query Rewriting via Large Language ModelsJie Liu, Barzan MozafariSIGMOD 2026 · 被引用 27 次
- ArchRAG: Attributed Community-based Hierarchical Retrieval-Augmented GenerationShu Wang, Yixiang Fang, Yingli Zhou, Xilin Liu 等AAAI 2026 · 被引用 23 次
- Cracking SQL Barriers: An LLM-based Dialect Translation SystemWei Zhou, Yuyang Gao, Xuanhe Zhou, Guoliang LiSIGMOD 2025 · 被引用 14 次
- SQLBarber: A System Leveraging Large Language Models to Generate Customized and Realistic SQL WorkloadsJiale Lao, Immanuel TrummerSIGMOD 2026 · 被引用 11 次
它引用的顶会 Paper11
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 被引用 64,255 次
- Toolformer: Language Models Can Teach Themselves to Use ToolsTimo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu 等NeurIPS 2023 · 被引用 5,989 次
- SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 被引用 2,496 次
- QueryFormer: A Tree Transformer Model for Query Plan RepresentationYue Zhao, Gao Cong, Jiachen Shi, Chunyan MiaoVLDB 2022 · 被引用 117 次
- A Learned Query Rewrite System using Monte Carlo Tree SearchXuanhe Zhou, Guoliang Li, Chengliang Chai, Jianhua FengVLDB 2022 · 被引用 85 次
相关 Paper
- ReSequel: Robust LLM-assisted Query Rewriting and Optimization using Templatization and SamplingSaeed Fathollahzadeh, Essam Mansour, Matthias BoehmVLDB 2026
- Can Large Language Models Be Query Optimizer for Relational Databases?Jie Tan, Kangfei Zhao, Rui Li, Jeffrey Xu Yu 等SIGMOD 2026 · 被引用 6 次
- Think Then Rewrite: Reasoning Enhanced Query Rewriting for Domain Specific RetrievalAng Li, Yufei Shi, Yuxuan Si, Yiquan Wu 等AAAI 2026
- LLM4Hint: Leveraging Large Language Models for Hint Recommendation in Offline Query OptimizationSuchen Liu, Yang Lin, Yinjun Han, Jun GaoICDE 2026 · 被引用 1 次
- λ-Tune: Harnessing Large Language Models for Automated Database System TuningVictor Giannakouris, Immanuel TrummerSIGMOD 2025 · 被引用 20 次
