Spool Cache Management via Residency Time Metrics
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Contemporary database systems are unable to directly involve the Query Optimizer in runtime spool cache management, leading to inefficient use of precious cache memory, as they lack the capability to effectively manage spool space usage based on data block residency times and sizes.
Innovation Solution
A system and method that estimate the residency time of data blocks and calculate a residency/size metric to determine whether to store or flush data blocks from cache memory, allowing for efficient cache utilization by prioritizing smaller data blocks with shorter residency times over larger ones with longer residency times.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If cache memory is used to store data blocks, then system performance is improved by reducing disk I/O, but cache memory is a precious resource that is expensive per byte and should be used efficiently
Solution Approach 1:
The patent changes the parameters of cache management by estimating residency time for each data block and calculating a metric that combines residency time and data block size. This allows the system to dynamically determine which data blocks to store in cache based on their expected utility and size, optimizing the trade-off between performance improvement and cache resource consumption.
Solution Approach 2:
The patent applies local quality by treating different data blocks differently based on their individual characteristics (residency time and size). Instead of a uniform cache allocation strategy, the system evaluates each data block separately and makes cache admission decisions based on local metrics, ensuring that cache space is allocated to the most valuable data blocks.
2Loss of energy
If larger data blocks with longer residency times are stored in cache, then disk I/O is reduced, but cache memory is consumed by larger blocks that could potentially store more smaller blocks with shorter residency times
Solution Approach 1:
The patent introduces a metric that combines residency time and data block size parameters to evaluate cache admission decisions. By changing from a simple size-based or residency-based decision to a combined metric, the system can identify data blocks that offer the best balance between reducing disk I/O and consuming cache space.
Solution Approach 2:
The patent applies partial action by not always storing data blocks in cache even when they meet certain criteria. Instead, the system uses the calculated metric to make selective decisions, storing only those data blocks that provide the most benefit relative to cache consumption, thereby avoiding excessive cache usage while still reducing disk I/O operations.
3Productivity
If the Query Optimizer is involved in runtime spool cache management, then cache utilization is optimized, but the complexity of the system increases
Solution Approach 1:
The patent applies universality by making the Query Optimizer multi-functional. The Query Optimizer not only generates execution plans but also participates in runtime cache management decisions. This allows the existing Query Optimizer component to serve multiple purposes, improving cache utilization without adding entirely new system components.
Solution Approach 2:
The patent applies self-service by enabling the Query Optimizer to use its own knowledge and metrics for cache management decisions. The system leverages the Query Optimizer's existing understanding of query characteristics and data access patterns to make cache admission decisions, allowing the system to optimize itself without external intervention or additional complex control mechanisms.
Data Source
AI summary
A system, method, and computer-readable medium that facilitate efficient use of cache memory in a massively parallel processing system are provided. A residency time of a data block to be stored in cache memory or a disk drive is estimated. A metric is calculated for the data block as a function of the residency time. The metric may further be calculated as a function of the data block size. One or more data blocks stored in cache memory are evaluated by comparing a respective metric of the one or more data blocks with the metric of the data block to be stored. A determination is then made to either store the data block on the disk drive or flush the one or more data blocks from the cache memory and store the data block in the cache memory. In this manner, the cache memory may be more efficiently utilized by storing smaller data blocks with lesser residency times by flushing larger data blocks with significant residency times from the cache memory. The disclosed cache management mechanisms are effective for many workloads and are adaptable to various database usage scenarios without requiring detailed studies of the particular data demographics and workload.


