Logging checkpoints properly

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.

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

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.