From 78f58f0f70e0b6542a8ecb4e3ceaf4d41cf58cb3 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 9 Apr 2009 16:20:50 +0000 Subject: [PATCH] Improve documentation about how checkpoint spreads I/O activity. --- doc/src/sgml/wal.sgml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml index 70675974a2..c21e4a4d62 100644 --- a/doc/src/sgml/wal.sgml +++ b/doc/src/sgml/wal.sgml @@ -1,4 +1,4 @@ - + Reliability and the Write-Ahead Log @@ -326,17 +326,26 @@ are points in the sequence of transactions at which it is guaranteed that the data files have been updated with all information written before the checkpoint. At checkpoint time, all dirty data pages are flushed to - disk and a special checkpoint record is written to the log file. + disk and a special checkpoint record is written to the log file. + (The changes were previously flushed to the WAL files.) In the event of a crash, the crash recovery procedure looks at the latest checkpoint record to determine the point in the log (known as the redo record) from which it should start the REDO operation. Any changes made to - data files before that point are known to be already on disk. Hence, after - a checkpoint has been made, any log segments preceding the one containing + data files before that point are guaranteed to be already on disk. Hence, after + a checkpoint, log segments preceding the one containing the redo record are no longer needed and can be recycled or removed. (When WAL archiving is being done, the log segments must be archived before being recycled or removed.) + + The checkpoint requirement of flushing all dirty data pages to disk + can cause a significant I/O load. For this reason, checkpoint + activity is throttled so I/O begins at checkpoint start and completes + before the next checkpoint starts; this minimizes performance + degradation during checkpoints. + + The server's background writer process will automatically perform a checkpoint every so often. A checkpoint is created every