8. Buffer Manager
The buffer manager manages data transfers between shared memory and persistent storage. Its efficiency significantly impacts DBMS performance. The PostgreSQL buffer manager operates with high efficiency.
Figure 8.1. Relations between buffer manager, storage, and backend processes.
Buffer manager performance has improved steadily over successive releases:
- Version 8.1 (2005) introduced an enhanced page replacement algorithm.
- Version 9.5 (2016) replaced the spinlocks that protected internal state changes with atomic operations.
- Version 18 (2025) introduced asynchronous I/O to read blocks from storage more efficiently.
This chapter describes the PostgreSQL buffer manager. The first section provides an overview, and the subsequent sections describe the following topics:
- Buffer manager structure
- Buffer manager locks
- Buffer management mechanisms
- Asynchronous I/O in PostgreSQL
- Dirty page flushing