Training-Free Query Optimization via LLM-Based Plan Similarity

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Vasilenko, Nikita, Demin, Alexander, Boorlakov, Vladimir
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866908436156907520
author Vasilenko, Nikita
Demin, Alexander
Boorlakov, Vladimir
author_facet Vasilenko, Nikita
Demin, Alexander
Boorlakov, Vladimir
contents 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, embedding-based optimizer guidance systems.
format Preprint
id arxiv_https___arxiv_org_abs_2506_05853
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Training-Free Query Optimization via LLM-Based Plan Similarity
Vasilenko, Nikita
Demin, Alexander
Boorlakov, Vladimir
Databases
Machine Learning
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, embedding-based optimizer guidance systems.
title Training-Free Query Optimization via LLM-Based Plan Similarity
topic Databases
Machine Learning
url https://arxiv.org/abs/2506.05853