Patent ID: 9244980
Filing Date: 2016-01-26
CPC Classification: G06F

Claim Text:
1. A computer-implemented method for selecting blocks for pushing out of a cache in a database system, the method comprising: receiving, by a database system, a request to execute a set of scan processes, each scan process corresponding to a database query and configured to read blocks of a table in a scan order; prefetching blocks of the table from a persistent storage device for storing in a cache of the database system and associating each prefetched block with scan processes expected to read data from the prefetched block; receiving an indication of processing of a first prefetched block by a scan process, the first prefetched block having a rank value based on the order of processing of data by the scan process; maintaining a count of the number of scan processes that are expected to read each prefetched block stored in cache, the maintaining comprising, responsive to receiving the indication of processing of the first prefetched block by the scan process: for each prefetched block with a rank in the scan order less than the rank value of the first prefetched block, decreasing the count for the prefetched block; responsive to decreasing the count of a second prefetched block, determining whether the count for the second prefetched block indicates that no scan processes are expected to read the second prefetched block; and marking the storage of the second prefetched block in the cache for pushing out of the cache if the count of the second prefetched block is determined to indicate that no scan processes are expected to read the second prefetched block.