1. cache hit and cache miss
When a user sends a data query request to the database for the first time, the database first searches for the data in the buffer zone. If the data to be accessed happens to be in the buffer zone (we call it cache hit) then read the data directly using the buffer.
Otherwise, if there is no user data in the buffer, this is called cache miss. In this case, the database will first read the user's data from the disk and put it into the buffer, the user then reads the data from the buffer.
Obviously, cache hit is faster than cache miss.
2. LRU (Least recently used algorithms) And MRU (Most recently used algorithms)
The basic concept of the so-called LRU (least recently used) algorithm is: when there is not enough available space in the memory, the buffer zone tries its best to retain the data most commonly used by users, in other words, the system preferentially clears "infrequently used data" and releases its space. the reason why "infrequently used data" should be enclosed in quotation marks is that the so-called seldom used standards are artificial and not strict. the so-called MRU (most recently used) algorithm has the opposite significance as the LRU algorithm.