mlsanityData to 14 Oct 2026

LLM-R2: A Large Language Model Enhanced Rule-based Rewrite System for Boosting Query Efficiency

arXiv 2404.12872 ↗First posted 19 Apr 2024cs.DB cs.CLcited by 16

Not on the map. Why?

Abstract (arXiv)

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 LLM-R2, adopting a large language model (LLM) to propose possible rewrite rules for a database rewrite system. To further improve the inference ability of LLM in recommending rewrite rules, we train a contrastive model by curriculum to learn query representations and select effective query demonstrations for the LLM. Experimental results have shown that our method can significantly improve the query execution efficiency and outperform the baseline methods. In addition, our method enjoys high robustness across different datasets.

Key facts. Cited by 16 papers in the map (data through 14 Oct 2026). Builds on 14 of its 42 references that are in the map. First posted on arXiv 19 Apr 2024.

Builds on

14 of 42 references.

References · 14

  1. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
  2. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  3. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
  4. 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
  5. 2017SemEval-2017 Task 1: Semantic Textual Similarity - Multilingual and Cross-lingual Focused Evaluationcited by 1,001
  6. 2023Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formattingcited by 817
  7. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
  8. 2023Larger language models do in-context learning differentlycited by 394
  9. 2023Unified Demonstration Retriever for In-Context Learningcited by 142
  10. 2018Apache Calcite: A Foundational Framework for Optimized Query Processing Over Heterogeneous Data Sourcescited by 25
  11. 2021Efficient Contrastive Learning via Novel Data Augmentation and Curriculum Learningcited by 14
  12. 2022Pseudo-Labeled Auto-Curriculum Learning for Semi-Supervised Keypoint Localizationcited by 14
2 more
  1. 2023QueryBooster: Improving SQL Performance Using Middleware Services for Human-Centered Query Rewritingcited by 5
  2. 2020Factor Windows: Cost-based Query Rewriting for Optimizing Correlated Window Aggregatescited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 11; 2026: 4.

16 papers.

Sort:

By area: