Adaptive Cost Model Evolution Through Online Learning: A Self-Tuning Framework for Dynamic Database Optimization
DOI:
https://doi.org/10.5935/jetia.v12i59.3378Resumo
Database cost models (CMs) are fundamental to query optimization, yet they suffer from accuracy degradation as system workloads and hardware configurations evolve. Traditional cost models rely on static calibration approaches that fail to adapt to dynamic operational environments. This paper introduces AdaptCM, a novel framework that leverages online learning and reinforcement learning techniques to enable continuous, autonomous cost model evolution. Unlike existing approaches that require manual recalibration or periodic offline updates, AdaptCM implements a self-tuning mechanism that learns from query execution feedback in realtime, automatically detecting model drift and adapting cost estimations without system disruption. We propose a multi-agent architecture where specialized learning agents manage different cost components (I/O, CPU, memory, network) and coordinate through a meta-learning controller. Our experimental evaluation on TPC-H, TPC- DS, and real-world production workloads demonstrates that AdaptCM achieves 23-41% higher prediction accuracy compared to PostgreSQL’s native cost model and 15- 28% improvement over state-of-the-art learned cost models. The framework reduces calibration overhead by 94% while maintaining model accuracy within 5% means relative error across diverse workload patterns and hardware configurations. Furthermore, AdaptCM’s adaptation latency remains under 50ms, making it suitable for production deployment in high-throughput database systems.








