I am reading a book on databases and a chapter in it talks about buffer manager and it's replacement strategies.
The two popular replacement startegies mentioned are
least recently used - LRU and
clock replacement. I am interested in details about
LRU is implemented via queue. When a
pin count is set to 0, page in memory is added to queue. When a replecement is needed, memory page from the start of the queue is used.
The book does not describe how
pin count (and dirty bit) for a page is stored. Is it stored inside the queue entries? Is it stored as part of the header in buffer pool frames?
Moreover, what happens if a page is accessed while being in the queue? Is it deleted from the queue immediately?