Re: NOLOGGING option, or ?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: NOLOGGING option, or ?
Дата
Msg-id 874qciv53r.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: NOLOGGING option, or ?  (Greg Stark <gsstark@mit.edu>)
Ответы Re: NOLOGGING option, or ?  (Simon Riggs <simon@2ndquadrant.com>)
Re: NOLOGGING option, or ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: NOLOGGING option, or ?  (Jochem van Dieten <jochemd@gmail.com>)
Список pgsql-hackers
Greg Stark <gsstark@MIT.EDU> writes:

> For CREATE TABLE AS in the non-PITR case you don't really need to WAL log the
> records at all. If it fails in the middle you just drop the table. When it
> completes you do a checkpoint before acknowledging the COMMIT.
> 
> I think this is already done for CREATE INDEX/REINDEX, also only in the
> non-PITR case.

Sorry to followup to my own message, but it occurs to me that COPY could be
made to automatically do this for the case of an empty destination table too.

I'm not sure if it should automatically check for an empty table or if there
should be an option for the user to indicate he wants COPY to replace the
current contents entirely. The latter might actually be more useful. .

But either way, you just WAL log a record indicating that the table should be
entirely empty. Then you fill it up without logging anything. Do a checkpoint
and then WAL log that the COPY is finished. If any failure occurs replay
leaves it empty.

Again this sadly only works in the non-PITR case.

-- 
greg



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

Предыдущее
От: Hans-Jürgen Schönig
Дата:
Сообщение: Re: regarding storage in postgres
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Cost of XLogInsert CRC calculations