mlsanityData to 14 Oct 2026

R-Bot: An LLM-based Query Rewrite System

arXiv 2412.01661 ↗First posted 2 Dec 2024cs.DB cs.AI cs.CLcited by 16

Not on the map. Why?

Abstract (arXiv)

Query rewrite is essential for optimizing SQL queries to improve their execution efficiency without changing their results. Traditionally, this task has been tackled through heuristic and learning-based methods, each with its limitations in terms of inferior quality and low robustness. Recent advancements in LLMs offer a new paradigm by leveraging their superior natural language and code comprehension abilities. Despite their potential, directly applying LLMs like GPT-4 has faced challenges due to problems such as hallucinations, where the model might generate inaccurate or irrelevant results. To address this, we propose R-Bot, an LLM-based query rewrite system with a systematic approach. We first design a multi-source rewrite evidence preparation pipeline to generate query rewrite evidences for guiding LLMs to avoid hallucinations. We then propose a hybrid structure-semantics retrieval method that combines structural and semantic analysis to retrieve the most relevant rewrite evidences for effectively answering an online query. We next propose a step-by-step LLM rewrite method that iteratively leverages the retrieved evidences to select and arrange rewrite rules with self-reflection. We conduct comprehensive experiments on real-world datasets and widely used benchmarks, and demonstrate the superior performance of our system, R-Bot, surpassing state-of-the-art query rewrite methods. The R-Bot system has been deployed at Huawei and with real customers, and the results show that the proposed R-Bot system achieves lower query latency.

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

Builds on

19 of 60 references.

References · 19

  1. 2022Training language models to follow instructions with human feedbackcited by 15,971
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
  4. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  5. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
  6. 2018UMAP: Uniform Manifold Approximation and Projection for Dimension Reductioncited by 2,898
  7. 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,212
  8. 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 832
  9. 2024MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategiescited by 723
  10. 2022A Survey on In-context Learningcited by 721
  11. 2024RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrievalcited by 532
  12. 2023A Survey of Hallucination in Large Foundation Modelscited by 368
7 more
  1. 2024The Dawn of Natural Language to SQL: Are We Fully Ready?cited by 79
  2. 2023GPTuner: A Manual-Reading Database Tuning System via GPT-Guided Bayesian Optimizationcited by 29
  3. 2023D-Bot: Database Diagnosis System using Large Language Modelscited by 28
  4. 2018Apache Calcite: A Foundational Framework for Optimized Query Processing Over Heterogeneous Data Sourcescited by 25
  5. 2024LLM-R2: A Large Language Model Enhanced Rule-based Rewrite System for Boosting Query Efficiencycited by 16
  6. 2024Revolutionizing Database Q&A with Large Language Models: Comprehensive Benchmark and Evaluationcited by 7
  7. 2023QueryBooster: Improving SQL Performance Using Middleware Services for Human-Centered Query Rewritingcited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 9; 2026: 7.

16 papers.

Sort:

By area: