From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: pgbench -i spends all its time doing CHECKPOINT |
Date: | 2002-01-06 19:47:04 |
Message-ID: | 200201061947.g06Jl4K02188@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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.
>
Very interesting. Thanks. Is there a reason someone would manually run
the CHECKPOINT command?
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | mlw | 2002-01-06 20:25:20 | Re: Spinning verses sleeping in s_lock |
Previous Message | Marc G. Fournier | 2002-01-06 19:40:51 | Re: anoncvs |