Caching and inserts on heaps

For inserts to heap tables, the insert takes place:

If an insert is the first row on a new page for the table, a clean data buffer is allocated to store the data page, as shown in Figure 7-5. This page starts to move down the MRU/LRU chain in the data cache as other processes read pages into memory.

If a second insert to the page takes place while the page is still in memory, the page is located in cache, and moves back to the top of the MRU/LRU chain.

Figure 7-5: Inserts to a heap page in the data cache

The changed data page remains in cache until it reaches the LRU end of the chain of pages. The page may be changed or referenced many times while it is in the cache, but it is written to disk only when one of the following takes place: