用大模型模拟专家调优,少交互实现高效索引推荐
LLMIA: An Out-of-the-Box Index Advisor via In-Context Learning with LLMs
- 基于上下文学习让大模型模仿数据库专家的迭代优化思路
- 在5个基准测试中仅用少量数据库交互就超越12种基线方法
- 无需调参或重训练,直接适用于真实商业场景
索引推荐对数据库性能优化至关重要。现有基于启发式或学习的方法常依赖低效的穷举搜索和不准确的成本估算,导致效率低下且实际延迟表现不佳。受经验丰富的数据库管理员通过反馈迭代优化索引的启发,我们提出 LLMIA——一种无需调优、开箱即用的索引推荐工具,利用大语言模型(LLM)通过上下文学习实现索引建议。LLMIA通过高质量示例库和全面的工作负载特征提取注入数据库知识,并迭代融合数据库反馈以引导索引优化。该设计使 LLMIA 能够模拟专家决策过程:在仅几次与数据库系统的交互中,为多种工作负载高效生成并优化索引。我们在五个标准 OLAP 基准测试(TPC-H 不同规模、JOB、TPC-DS、SSB)上进行大量实验,结果表明其始终优于或匹配12种基线方法,以极少的数据库交互生成更优索引。此外,LLMIA 在两个真实商业工作负载上也表现出强泛化能力,无需额外适应或重训练即可提供高质量推荐,凸显其开箱即用特性。
原文摘要 · Abstract (English)
Index recommendation is crucial for optimizing database performance. However, existing heuristic- and learning-based methods often rely on inefficient exhaustive search and estimated costs, leading to low efficiency (due to the vast search space) and unsatisfactory actual latency (due to inaccurate estimations). Inspired by the refinement strategies of experienced DBAs-who efficiently identify and iteratively refine indexes with database feedback-we present LLMIA, an out-of-the-box, tuning-free index advisor leveraging large language models (LLMs) through in-context learning for index recommendation. LLMIA injects database expertise into the LLM using a high-quality demonstration pool and comprehensive workload feature extraction, while iteratively incorporating database feedback to guide the index refinement. This design enables LLMIA to emulate the decision-making process of expert DBAs: efficiently recommending and refining indexes for various workloads within just a few interactions with the DBMS. We validate LLMIA with extensive experiments on five standard OLAP benchmarks (TPC-H with different scales, JOB, TPC-DS, SSB), where it consistently outperforms or matches 12 baselines by producing superior index recommendations with minimal database interactions. Additionally, LLMIA demonstrates robust generalization on two real-world commercial workloads, delivering high-quality recommendations without the need for additional adaptation or retraining, highlighting its out-of-the-box capability.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。