Training-Free Query Optimization via LLM-Based Plan Similarity
Nikita Vasilenko, Alexander Demin, Vladimir Boorlakov

TL;DR
This paper presents LLM-PM, a training-free framework that uses pre-trained LLM embeddings of execution plans to improve SQL query optimization by recommending hints, achieving significant speed-ups without additional model training.
Contribution
Introduces LLM-PM, a novel, training-free approach leveraging pre-trained plan embeddings for query optimization guidance based on plan similarity.
Findings
Achieves 21% average query latency reduction on JOB-CEB benchmark.
Demonstrates effectiveness of plan embeddings for training-free optimizer guidance.
Provides a lightweight validation and fallback mechanism for reliable hint selection.
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. 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,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Database Systems and Queries · Cloud Computing and Resource Management · Data Quality and Management
MethodsHierarchical Information Threading
