Gnoseed
Databases · Flashcard

Which replacement algorithm does PostgreSQL use to pick a victim buffer?

Why this is the answer

PostgreSQL uses clock sweep, a cheap approximation of LRU: the hand skips pinned buffers and decrements usage counts, taking the first unpinned buffer whose count is zero. A real LRU list would need a global lock on every access, 2Q keeps multiple queues PostgreSQL does not have, and plain FIFO would ignore usage entirely.

Read more in the docs
Study in Gnoseed →