Reqo通过可解释性、强表示与不确定性感知,提升查询优化的鲁棒性与可信度。
Reqo: A Comprehensive Learning-Based Cost Model for Robust and Explainable Query Optimization
- 引入子图贡献量化与生成提示,增强计划可解释性
- 基于双向图神经网络与门控循环单元,提升计划结构表征能力
- 融合不确定性的排序学习模型,提升计划选择鲁棒性
尽管机器学习在生成和选择更高效查询计划方面展现出潜力,但基于学习的成本模型(LCMs)的鲁棒性仍面临挑战。当前的LCMs缺乏可解释性,削弱了用户信任,并限制了从成本预测中获取改进计划质量的洞察。准确地将树状查询计划转换为表示形式也至关重要,因为遗漏任何细节都可能影响后续成本模型性能。此外,成本估算中的固有不确定性导致预测不准确,进而引发次优计划选择。为此,我们提出Reqo,一个稳健且可解释的查询优化成本模型,全面改进查询优化的三个主要阶段:计划生成、计划表示和计划选择。Reqo集成三项创新:首个量化子图贡献并生成计划生成提示的可解释技术;基于双向图神经网络(Bi-GNNs)与门控循环单元(GRU)聚合器的新式树模型,以更好捕捉节点级与结构信息;以及一种不确定性感知的排序学习成本估计器,能自适应整合成本与不确定性以增强计划选择的鲁棒性。大量实验表明,Reqo在所有三个阶段均优于现有最先进方法。
原文摘要 · Abstract (English)
Although machine learning (ML) shows potential in improving query optimization by generating and selecting more efficient plans, ensuring the robustness of learning-based cost models (LCMs) remains challenging. These LCMs currently lack explainability, which undermines user trust and limits the ability to derive insights from their cost predictions to improve plan quality. Accurately converting tree-structured query plans into representations via tree models is also essential, as omitting any details may negatively impact subsequent cost model performance. Additionally, inherent uncertainty in cost estimation leads to inaccurate predictions, resulting in suboptimal plan selection. To address these challenges, we introduce Reqo, a Robust and Explainable Query Optimization cost model that comprehensively enhances three main stages in query optimization: plan generation, plan representation, and plan selection. Reqo integrates three innovations: the first explainability technique for LCMs that quantifies subgraph contributions and produces plan generation hints to enhance candidate plan quality; a novel tree model based on Bidirectional Graph Neural Networks (Bi-GNNs) with a Gated Recurrent Unit (GRU) aggregator to further capture both node-level and structural information and effectively strengthen plan representation; and an uncertainty-aware learning-to-rank cost estimator that adaptively integrates cost estimates with uncertainties to enhance plan selection robustness. Extensive experiments demonstrate that Reqo outperforms state-of-the-art approaches across all three stages.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。