Training-Free Query Optimization via LLM-Based Plan Similarity

Nikita Vasilenko, Alexander Demin, Vladimir Boorlakov
6/6/2025
cs.DBcs.LG

No confident code implementation found for this paper.

Abstract

Large language model (LLM) embeddings offer a promising new avenue for database query optimization. In this paper, we explore how pre-trained execution plan embeddings can guide SQL query execution without the need for additional model training.

Show full abstract

We introduce LLM-PM (LLM-based Plan Mapping), a framework that embeds the default execution plan of a query, finds its k nearest neighbors among previously executed plans, and recommends database hintsets based on neighborhood voting. A lightweight consistency check validates the selected hint, while a fallback mechanism searches the full hint space when needed. Evaluated on the JOB-CEB benchmark using OpenGauss, LLM-PM achieves an average speed-up of 21% query latency reduction. This work highlights the potential of LLM-powered embeddings to deliver practical improvements in query performance and opens new directions for training-free, embedding-based optimizer guidance systems.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{vasilenko2025trainingfree,
  title  = {Training-Free Query Optimization via LLM-Based Plan Similarity},
  author = {Nikita Vasilenko and Alexander Demin and Vladimir Boorlakov},
  year   = {2025},
  eprint = {2506.05853},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.05853v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.05853.svg)](https://codeofpaper.com/paper/2506.05853)

Discussion