Database buffer page replacement policy

xiaoxiao2021-03-06  84

When there is no available page in the slow pool, the buffer manager wants to write the data of some pages back to the disk with a policy, and the free page is sent to save the data of the read and write operations later. This process is called a page. Replacement.

SQL Server 2000 uses a dedicated process that uses the clock algorithm for page replacement. It sets a counter for each buffer, and sequentially scans each buffer in the buffer pool, check the counter. If the counter is zero, this buffer can be recycled. Thus, the system first writes the buffer internal organs into the disk, and then places the mid-center district in the free buffer list. If the value of the counter is not zero, the system reduces the value of the counter. When a process accesses data from the buffer, the counter's counter increases.

For those generated by higher cost, the system uses a counter with a higher reference value through the objects generated by the buffer. When scanning, the value of these counters is not simple, but is reduced in some strategy (eg, divided by 4), which ensures that it will not become zero, so that it can be stored in memory.

Others can be referred to such replacement strategy in the design of the buffer design (when the cache is not enough to put down all data or in order to save memory).

转载请注明原文地址:https://www.9cbs.com/read-95677.html

New Post(0)