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
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]