Pith. sign in

REVIEW 4 cited by

Can Large Language Models Be Query Optimizer for Relational Databases?

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2502.05562 v1 pith:PAHKPXTC submitted 2025-02-08 cs.DB

classification cs.DB
keywords queryoptimizationllm-qollmsoptimizersplandataexecution
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

Query optimization, which finds the optimized execution plan for a given query, is a complex planning and decision-making problem within the exponentially growing plan space in database management systems (DBMS). Traditional optimizers heavily rely on a certain cost model constructed by various heuristics and empirical tuning, probably leading to generating suboptimal plans. Recent developments of Large Language Models (LLMs) have demonstrated their potential in solving complex planning and decision-making problems, such as arithmetic and programmatic tasks. In this paper, we try to explore the potential of LLMs in handling query optimization and propose a tentative LLM-based query optimizer dubbed LLM-QO, established on PostgreSQL's execution engine. In LLM-QO, we formulate query optimization in an autoregressive fashion which directly generates the execution plan without explicit plan enumeration. To investigate the essential input of LLM-QO, we design a customized data recipe named QInstruct to collect the training data from various optimizers and serialize the database's meta data, queries and corresponding plans into a textual format. Based on QInstruct, we implement a two-stage fine-tuning pipeline, Query Instruction Tuning (QIT) and Query Direct Preference Optimization (QDPO), to empower the capability of general-purpose LLMs in handling query optimization. In our experiments, LLM-QO can generate valid and high-quality plans and consistently outperforms both traditional and learned optimizers on three query workloads. Our findings verify that LLMs can be derived as query optimizers where generalization, efficiency and adaptivity deserve further research efforts.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 4 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. ReSequel: Robust LLM-assisted Query Rewriting and Optimization using Templatization and Sampling

    cs.DB 2026-06 conditional novelty 7.0 of 10

    ReSequel uses LLMs guided by metadata-derived templates and sampling-based verification to rewrite SQL queries, delivering up to 16x workload speedups over native DBMSs and 22x over prior LLM baselines across eight be...

  2. SEFRQO: A Self-Evolving Fine-Tuned RAG-Based Query Optimizer

    cs.DB 2025-08 unverdicted novelty 5.0 of 10

    SEFRQO claims a self-evolving fine-tuned LLM with retrieval and execution feedback reduces query latency versus PostgreSQL, but the provided body is a different paper, blocking verification.

  3. Training-Free Query Optimization via LLM-Based Plan Similarity

    cs.DB 2025-06 conditional novelty 5.0 of 10

    LLM-PM, a training-free system that transfers optimizer hints from nearest-neighbour LLM plan embeddings, reports a 21.1% total runtime reduction on JOB-CEB over openGauss.

  4. A Survey of LLM $\times$ DATA

    cs.DB 2025-05 conditional novelty 5.0 of 10

    A comprehensive survey of the bidirectional links between LLMs and data management, organized as DATA4LLM and LLM4DATA with a new 'IaaS' data-quality framework.

Pith tools