The principal component of conventional database query optimizers is a cost model that is used to estimate expected performance of query plans. The accuracy of the cost model has direct impact on the optimality of execution plans selected by the optimizer and thus, on the resulting query latency. Several common parameters of cost models in modern DBMS are related to the performance of CPU and I/O and are typically set by a database administrator upon system tuning. However these performance characteristics are not stable and therefore, a single point estimation may not suffice for all DB load regimes. In this paper, we propose an Adaptive Cost Model (ACM) which dynamically optimizes CPU- and I/O-related plan cost parameters at DB runtime. By continuously monitoring query execution statistics and the state of DB buffer cache ACM adjusts cost parameters without the need for manual intervention from a database administrator. This allows for responding to changes in the workload and system performance ensuring more optimal query execution plans. We describe the main ideas in the implementation of ACM and report on a preliminary experimental evaluation showing 20\% end-to-end latency improvement on TPC-H benchmark.
翻译:传统数据库查询优化器的核心组件是用于评估查询计划预期性能的成本模型。该成本模型的准确性直接影响优化器所选执行计划的最优性,进而影响最终的查询延迟。现代数据库管理系统中成本模型的若干常见参数与CPU和I/O性能相关,通常由数据库管理员在系统调优时设置。然而这些性能特征并不稳定,因此单点估计可能无法适应所有数据库负载状态。本文提出一种自适应成本模型(ACM),能够在数据库运行时动态优化与CPU和I/O相关的计划成本参数。通过持续监控查询执行统计数据和数据库缓冲缓存状态,ACM无需数据库管理员手动干预即可调整成本参数。这使得系统能够响应工作负载和系统性能的变化,确保生成更优的查询执行计划。我们阐述了ACM实现的核心思想,并报告了初步实验评估结果:在TPC-H基准测试中实现了20\%的端到端延迟改进。