Abstract
Modern database management systems (DBMS) feature hundreds of configuration parameters, or "knobs," that significantly impact performance. Finding optimal settings is a complex task typically addressed by "black-box" machine learning methods like Reinforcement Learning (RL). This paper explores the potential of Large Language Models (LLMs) to revolutionize this process. By leveraging their internal knowledge and reasoning capabilities, LLMs can prune irrelevant settings, initialize optimization models, and recommend high-performance configurations. Our evaluation shows that LLMs not only match state-of-the-art performance but do so with far greater efficiency, interpretability, and generalization across different database engines and hardware.
Introduction
Configuring a DBMS like MySQL or PostgreSQL for a specific workload is a daunting task. Traditional automated tuning methods, while effective, suffer from high iteration costs, lack of transparency, and poor generalization to new environments. These methods often require hundreds of "Try-Collect-Adjust" cycles, acting as black boxes that offer no explanation for their choices. This paper investigates whether LLMs can overcome these limitations by acting as "intelligent agents" in the tuning loop.
The LLM-Driven Tuning Framework
The researchers decompose the tuning process into three distinct subtasks, replacing traditional algorithmic components with LLM-driven solutions:
- Knob Pruning: LLMs identify the most impactful knobs (typically around 10) out of hundreds, effectively reducing the search space.
- Model Initialization: LLMs suggest high-quality initial configurations to "warm start" traditional optimization models, such as Bayesian Optimization, drastically speeding up convergence.
- Knob Recommendation: Through an iterative process, the LLM receives performance feedback (e.g., throughput, latency) and refines configurations using "Chain-of-Thought" (CoT) reasoning.
The study evaluated various models, including closed-source leaders (GPT-4o, GPT-4-Turbo, Claude-3-Opus) and open-source alternatives (Llama-3, Qwen2), using prompts that included task descriptions, knob details, and real-time feedback.
Experimental Setup
The evaluation utilized industry-standard benchmarks across diverse environments:
- Workloads: SYSBENCH (Online Transaction Processing - OLTP) and JOB (Join Order Benchmark for analytical workloads - OLAP).
- Database Engines: MySQL 5.7, PostgreSQL 10.0, and TiDB 8.2.
- Hardware: Two distinct server configurations to test hardware adaptability.
Key Results and Performance
LLMs demonstrated remarkable efficiency and performance. In the knob recommendation task, models like GPT-4-Turbo and Qwen2-7B achieved near-optimal performance in just 9 to 14 iterations. In contrast, the traditional SMAC method required 375 iterations to reach comparable levels.
Furthermore, initializing Bayesian Optimization with LLM-generated configurations resulted in an average speedup of 71.42%, with some scenarios reaching a 99.37% reduction in tuning time.
Qualitative Advantages
Beyond raw performance, LLMs offer two critical advantages:
- Interpretability: Unlike RL agents, LLMs provide rationales for their recommendations (e.g., explaining that increasing a buffer size improves join efficiency). This transparency allows database administrators (DBAs) to audit and trust the system.
- Zero-Shot Generalization: LLMs adapted to new engines like TiDB and hardware changes simply by updating the prompt. Traditional methods often require extensive retraining or code modifications for such shifts.
Limitations and Future Work
Despite their success, challenges remain. Privacy and cost are concerns for closed-source APIs. Open-source models occasionally struggle with strict output formatting or redundancy. Future research directions include fine-tuning LLMs on database documentation and implementing Retrieval-Augmented Generation (RAG) to provide models with real-time access to the latest manuals, moving toward a fully autonomous, end-to-end tuning pipeline.
Summary updated