Unexplained writes

There are several situations where you can find yourself executing statements that only read against the database, yet find significant write volume happening on the database disk.

Parts of the buffer cache must be dirty before writes happen, so if any of that work is left hanging around, it could be involved. Flushing everything out with a manual checkpoint is one way to assure that it's not the cause of the writes.

A second small source of writes are the access time updates that many operating systems do every time you read from a file. It was suggested these get turned off in Chapter 4, Disk Setup, and the actual volume of writes from them is pretty low, anyway.

If the volume of writes is substantial and this data was ...

Get PostgreSQL 10 High Performance 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.