In general, the basis for maintaining a cache is to minimize the amount of physical I/O activity when accessing data pages. When RPM receives a page request, there are two possibilities: the page exists in the cache, or it does not. If the page exists, RPM returns it to the requestor. If it does not, a buffer in the cache is reserved and a physical I/O is initiated to read the page into the buffer.
RPM handles the caching of data pages using the LRU-K page replacement algorithm, which is based on the page replacement policy that, in most database systems, is known as “least recently used” (LRU). LRU‑K overcomes the limitations of the traditional LRU algorithm by maintaining the history of the last K references to a page. The K in LRU-K is a parameter where K>=2 (K=1 is valid but ignored because it is the same as the traditional LRU algorithm). RPM uses a value of 2 for K. LRU-2 gives improved performance over LRU-1 and is more adaptive to changes in access patterns than LRU-K for K greater than 2.