arXiv:2412.02372cs.DBcs.AI2024-12被引 4

提出高效可靠的查询优化提示生成模型,显著降低查询延迟。

HERO: Hint-Based Efficient and Reliable Query Optimizer

  • 采用上下文感知模型集成与图存储结构,提升提示推荐效率和可靠性。
  • 在JOB基准上实现3倍查询延迟降低,接近粗粒度提示的最佳效果。
  • 模型可解释且易调试,适合生产环境部署。

我们提出一种新型学习型查询优化模型,通过生成查询提示来获得更优的执行计划。该模型解决了学习型提示优化中的三大挑战:可靠提示推荐(保证查询延迟不恶化)、高效提示探索以及快速推理。通过对现有基于神经网络的提示优化方法进行深入分析,实验验证了这些挑战的存在。我们的解决方案包括基于上下文感知模型集成的新推理架构、用于可靠提示建议与快速推理的图存储,以及结合局部搜索算法的预算控制训练流程,以应对指数级搜索空间问题。在标准基准上的实验表明,该模型在粗粒度提示下的优化能力接近最优水平。在操作符提示基础上增加对并行度(query dop)的控制,使模型在JOB基准上实现3倍延迟降低,树立了新的优化标准。模型具备可解释性与易调试性,对生产环境部署至关重要。

原文摘要 · Abstract (English)

We propose a novel model for learned query optimization which provides query hints leading to better execution plans. The model addresses the three key challenges in learned hint-based query optimization: reliable hint recommendation (ensuring non-degradation of query latency), efficient hint exploration, and fast inference. We provide an in-depth analysis of existing NN-based approaches to hint-based optimization and experimentally confirm the named challenges for them. Our alternative solution consists of a new inference schema based on an ensemble of context-aware models and a graph storage for reliable hint suggestion and fast inference, and a budget-controlled training procedure with a local search algorithm that solves the issue of exponential search space exploration. In experiments on standard benchmarks, our model demonstrates optimization capability close to the best achievable with coarse-grained hints. Controlling the degree of parallelism (query dop) in addition to operator-related hints enables our model to achieve 3x latency improvement on JOB benchmark which sets a new standard for optimization. Our model is interpretable and easy to debug, which is particularly important for deployment in production.

查询优化提示生成深度学习数据库

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。