LaPuda:面向多模态数据的基于策略的LLM查询优化器
LaPuda: LLM-Enabled Policy-Based Query Optimizer for Multi-modal Data
AI总结:
本文提出LaPuda,一种基于LLM和抽象策略的多模态查询优化器,利用少量策略引导优化并引入GCD算法确保优化方向,实验显示执行速度比基线快1~3倍。
摘要:
大型语言模型(LLM)在机器学习和深度学习领域标志着一个关键时刻。近期,其查询规划能力已被研究,包括单模态和多模态查询。然而,目前尚无关于LLM查询优化能力的工作。作为显著影响查询计划执行性能的关键(甚至可能是最重要的)步骤,此类分析和尝试不应被遗漏。另一方面,现有的查询优化器通常基于规则或基于规则+基于代价,即它们依赖人工创建的规则来完成查询计划的重写/转换。鉴于现代优化器包含数百至数千条规则,以类似方式设计多模态查询优化器非常耗时,因为我们必须枚举尽可能多的多模态优化规则,而这一问题至今尚未得到很好解决。在本文中,我们研究了LLM的查询优化能力,并利用LLM设计了LaPuda,一种新颖的基于LLM和策略的多模态查询优化器。LaPuda无需枚举具体详细的规则,仅需少量抽象策略来引导LLM进行优化,从而节省大量时间和人力。此外,为防止LLM犯错或进行负优化,我们借鉴梯度下降的思想,提出了一种引导式代价下降(GCD)算法来执行优化,使优化保持在正确方向上。在我们的评估中,我们的方法在大多数情况下持续优于基线。例如,我们方法生成的优化计划比基线生成的计划执行速度快1~3倍。
英文摘要:
Large language model (LLM) has marked a pivotal moment in the field of machine learning and deep learning. Recently its capability for query planning has been investigated, including both single-modal and multi-modal queries. However, there is no work on the query optimization capability of LLM. As a critical (or could even be the most important) step that significantly impacts the execution performance of the query plan, such analysis and attempts should not be missed. From another aspect, existing query optimizers are usually rule-based or rule-based + cost-based, i.e., they are dependent on manually created rules to complete the query plan rewrite/transformation. Given the fact that modern optimizers include hundreds to thousands of rules, designing a multi-modal query optimizer following a similar way is significantly time-consuming since we will have to enumerate as many multi-modal optimization rules as possible, which has not been well addressed today. In this paper, we investigate the query optimization ability of LLM and use LLM to design LaPuda, a novel LLM and Policy based multi-modal query optimizer. Instead of enumerating specific and detailed rules, LaPuda only needs a few abstract policies to guide LLM in the optimization, by which much time and human effort are saved. Furthermore, to prevent LLM from making mistakes or negative optimization, we borrow the idea of gradient descent and propose a guided cost descent (GCD) algorithm to perform the optimization, such that the optimization can be kept in the correct direction. In our evaluation, our methods consistently outperform the baselines in most cases. For example, the optimized plans generated by our methods result in 1~3x higher execution speed than those by the baselines.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。