Checkpoints are an integral part of a PostgreSQL server. Table data is not modified during query execution until modified rows, index pages, and other structures are committed to the Write Ahead Log (WAL). WAL files are also known as checkpoint segments. When the cumulative size of these files exceeds max_wal_size
-or the time since the last checkpoint exceeds checkpoint_timeout
-the data files are modified to reflect the changes.
Note
In versions older than PostgreSQL 9.5, checkpoints were specified as a count of 16MB files with the checkpoint_segments
parameter, rather than a cumulative total size. The setting for max_wal_size
in MB is roughly equivalent to checkpoint_segments
* 16.
This decoupled writing ensures database integrity at the cost of doubling the necessary disk writes. This is the main reason why experienced PostgreSQL DBAs interested in performance move the WAL location to a separate storage device. However, even moving the WAL files to another device...