Workload-Aware Buffer Prefetching for Database Systems
摘要
Database systems play a vital role in today’s information society. As modern database systems are widely adopted across diverse domains, their workloads and data access patterns are becoming increasingly complex, posing new challenges for traditional buffer management mechanisms. Neither conventional buffer management strategies nor existing adaptive algorithms can effectively address a key issue: When data access hotspots shift dramatically, how to avoid a prolonged drop in the buffer hit rate and ensure that it recovers quickly? We refer to this challenge as the "buffer cold-start" problem. To address this problem, and considering the periodic nature of workloads in many real-world applications, we propose to adopt buffer prefetching to proactively load potential hot data pages. This approach shortens both the duration of buffer performance degradation and the time required for the buffer hit rate to recover during hotspot transitions, thereby effectively addressing the buffer cold-start problem under periodic workloads. In particular, we introduce pre-buffer, a workload-aware buffer prefetching framework. Pre-buffer identifies hot pages within a given worklaod and, upon detecting a workload change, uses similarity metrics to match and predict the hot page set of the new workload. An independent prefetching thread then loads these hot pages into the buffer in advance. Based on the characteristics of real database experimental scenarios, we design two representative workloads to evaluate our approach. Experimental results show that the proposed workload-aware buffer prefetching scheme significantly improves the recovery speed of the buffer hit rate under dynamic workload changes, thereby enhancing the overall performance of the database buffer system.