PostgreSQL 8.0, the 2q memory manager
With the revolutionary PostgreSQL 8.0 were introduced a different memory manager, the two queues.
This algorithm uses three list of buffer page pointers called cache directory blocks (CDB). The lists T1,T2 are actually pointing buffered pages. B1 lists pages been recently in the shared buffer.
The list T1 is used as LRU for the pages loaded from disk. The list T2
is used as LRU list for pages already cached and evicted from the list
T1. The list B1 is a LRU list of pages recently evicted from the shared
buffer.
When a new page is read from disk is put initially at the beginning of
T1. All the CDB in T1 are shifted and the last element in T1 is evicted
from the shared buffer, its CDB is put at the B1’s top.