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

TL;DR
This paper introduces LLM-R2, a novel query rewrite system using large language models to generate efficient SQL query rewrites, overcoming limitations of traditional rule-based methods and improving execution efficiency and robustness.
Contribution
The paper presents a new LLM-based query rewrite approach that learns to recommend rewrite rules, reducing resource costs and dependency on DBMS estimators.
Findings
Significantly improves query execution efficiency
Outperforms baseline rewrite methods
Demonstrates high robustness across datasets
Abstract
Query rewrite, which aims to generate more efficient queries by altering a SQL query's structure without changing the query 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. Firstly, 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. Secondly, 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 method of query rewrite named…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Database Systems and Queries · Data Mining Algorithms and Applications · Machine Learning and Data Classification
