Re: question regarding full_page_write

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: question regarding full_page_write
Дата
Msg-id 4E52CCAA.8090104@2ndQuadrant.com
обсуждение исходный текст
Ответ на Re: question regarding full_page_write  (Martín Marqués <martin.marques@gmail.com>)
Ответы Re: question regarding full_page_write  (Martín Marqués <martin.marques@gmail.com>)
Список pgsql-general
On 08/22/2011 05:07 PM, Martín Marqués wrote:
> My question regarding your answer is, why is it important for the
> first page after a checkpoint and not on other page writes?
>

The first time a page is written after a checkpoint, when
full_page_writes is on, the entire 8K page is written out to disk at
that point.  The idea is that if the page is corrupted in any way by a
partial write, you can restore it to a known good state again by using
this version.  After that copy, though, additional modifications to the
page only need to save the delta of what changed, at the row level.  If
there's a crash, during recovery the full page image will be written,
then the series of deltas, ending up with the same data as was intended.

This whole mechanism resets again each time a checkpoint finishes, and
the full page writes start all over again.  One of the main purposes of
checkpoints are to move forward the pointer of how far back crash
recovery needs to replay from.  Starting each new checkpoint over again,
with a full copy of all the data modified going into the WAL, it is part
of that logic.

--
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us


В списке pgsql-general по дате отправления:

Предыдущее
От: Martín Marqués
Дата:
Сообщение: Re: question regarding full_page_write
Следующее
От: Courtin Olivier
Дата:
Сообщение: SETOF anyelement - get_call_result_type