Key points are not available for this paper at this time.
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.
Building similarity graph...
Analyzing shared references across papers
Loading...
Zhaodonghui Li
Nanyang Technological University
Haitao Yuan
Liaoning Jianzhu Vocational University
Hui‐Ming Wang
Xi'an Jiaotong University
Proceedings of the VLDB Endowment
Nanyang Technological University
Singapore University of Technology and Design
Building similarity graph...
Analyzing shared references across papers
Loading...
Li et al. (Sun,) studied this question.
synapsesocial.com/papers/6a1d3fda33e2df9c962f3115 — DOI: https://doi.org/10.14778/3696435.3696440