Re: pgbench -i spends all its time doing CHECKPOINT - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pgbench -i spends all its time doing CHECKPOINT
Date
Msg-id 26310.1010342254@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgbench -i spends all its time doing CHECKPOINT  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: pgbench -i spends all its time doing CHECKPOINT  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> question is if we do a big transaction that needs 10 log segments, do we
> force an early CHECKPOINT to clear out the WAL segments or do we just
> wait for the proper interval?

A checkpoint is forced after every CHECKPOINT_SEGMENTS log segments,
regardless of longevity of transactions.  See
http://developer.postgresql.org/docs/postgres/wal-configuration.html

Since segments before the checkpoint-before-last are deleted or recycled
after each checkpoint, the maximum number of back segments would
normally be 2 * CHECKPOINT_SEGMENTS.  We also pre-create WAL_FILES
future log segments.  Counting the current segment gives a total of
WAL_FILES + 2 * CHECKPOINT_SEGMENTS + 1 log segments.

AFAICS, the only way to force the current code into creating more than
WAL_FILES + 2 * CHECKPOINT_SEGMENTS + 1 log segments is to be generating
WAL entries at such a high rate that more than WAL_FILES log segments
are filled before a triggered checkpoint can be completed.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgbench -i spends all its time doing CHECKPOINT
Next
From: Tom Lane
Date:
Subject: Re: anoncvs