高效查询重优化与明智子查询选择
Efficient Query Re-optimization with Judicious Subquery Selections
AI总结:
针对现有查询重优化依赖初始计划而可能非最优的问题,提出QuerySplit算法,直接从逻辑计划生成子查询并优先执行低损害子查询,在PostgreSQL上实现,较次优方案执行时间减少35%,与最优优化器差距在4%以内。
摘要:
查询重优化是一种自适应查询处理技术,在查询执行的特定节点重新调用优化器。其目标是根据运行时收集的统计信息动态纠正基数估计误差,调整查询计划以提升整体性能。我们指出现有重优化算法的一个关键弱点:其子查询划分和重优化触发策略严重依赖优化器的初始计划,而该计划可能远非最优。因此,我们提出QuerySplit,一种新颖的重优化算法,它跳过可能具有误导性的全局计划,直接从逻辑计划生成子查询作为基本重优化单元。通过开发一个优先执行“损害较小”子查询的成本函数,QuerySplit成功推迟(有时甚至避免)复杂大连接的执行,以最大化其输入规模较小的概率。我们在PostgreSQL中实现了QuerySplit,并使用Join Order Benchmark将我们的解决方案与四种最先进的重优化算法进行比较。实验表明,与次优方案相比,QuerySplit将基准执行时间减少了35%。QuerySplit与最优优化器之间的性能差距在4%以内。
英文摘要:
Query re-optimization is an adaptive query processing technique that re-invokes the optimizer at certain points in query execution. The goal is to dynamically correct the cardinality estimation errors using the statistics collected at runtime to adjust the query plan to improve the overall performance. We identify a key weakness in existing re-optimization algorithms: their subquery division and re-optimization trigger strategies rely heavily on the optimizer's initial plan, which can be far away from optimal. We, therefore, propose QuerySplit, a novel re-optimization algorithm that skips the potentially misleading global plan and instead generates subqueries directly from the logical plan as the basic re-optimization units. By developing a cost function that prioritizes the execution of less "damaging" subqueries, QuerySplit successfully postpones (sometimes avoids) the execution of complex large joins to maximize their probability of having smaller input sizes. We implemented QuerySplit in PostgreSQL and compared our solution against four state-of-the-art re-optimization algorithms using the Join Order Benchmark. Our experiments show that QuerySplit reduces the benchmark execution time by 35% compared to the second-best alternative. The performance gap between QuerySplit and an optimal optimizer is within 4%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。