Buffer Pools, Pins, and Dirty Pages

Manage cached database pages with explicit in-use counts and distinguish choosing an eviction victim from making it recoverable.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. A logical page can occupy any buffer frame
  2. A dirty victim carries a logging dependency

A logical page can occupy any buffer frame

On a page request, a buffer manager checks its page-to-frame mapping. If cached, it pins the frame against eviction while the caller uses it. If absent, it chooses an eligible frame and reads the page. An unpin ends that use without necessarily removing the page. Several callers can pin the same frame, with content concurrency governed separately.

A dirty victim carries a logging dependency

An unpinned clean frame can usually be reused after removing its mapping. A dirty frame may require a write, and a logged engine can require the corresponding log records to become durable first. Waiting for every miss to write a dirty victim can hurt latency, motivating background writeback. Slotted pages describe one layout stored in frames. Write-ahead logging gives the recovery reason for this order.[1][2]

References

  1. CMU 15-445/645, Introduction to Database Systems: Lectures ↩
  2. PostgreSQL Global Development Group, PostgreSQL Documentation ↩