Clock-sweep Replacement Strategy
PostgreSQL page replacement strategy: clock-sweep
- treat buffer pool as circular list of buffer slots
-
NextVictimBuffer holds index of next possible evictee
- if this page is pinned or "popular", leave it
-
usage_count implements "popularity/recency" measure
- incremented on each access to buffer (up to small limit)
- decremented each time considered for eviction
- increment
NextVictimBuffer and try again (wrap at end)
|