Re: [Bizgres-general] WAL bypass for INSERT, UPDATE and

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: [Bizgres-general] WAL bypass for INSERT, UPDATE and
Дата
Msg-id 1136333515.5052.273.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: [Bizgres-general] WAL bypass for INSERT, UPDATE and  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: [Bizgres-general] WAL bypass for INSERT, UPDATE and  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
On Thu, 2005-12-29 at 11:37 -0500, Bruce Momjian wrote:
> Having COPY behave differently because it is
> in a transaction is fine as long as it is user-invisible, but once you
> require users to do that to get the speedup, it isn't user-invisible
> anymore.

Since we're agreed on adding ALTER TABLE rather than COPY LOCK, we have
our explicit mechanism for speedup.

However, it costs a single line of code and very very little execution
time to add in the optimization to COPY to make it bypass WAL when
executed in the same transaction that created the table. Everything else
is already there.

As part of the use_wal test:
+     if (resultRelInfo->ri_NumIndices == 0 && 
+         !XLogArchivingActive()            &&
>>         (cstate->rel->rd_createSubid != InvalidSubTransactionId ))
+             use_wal = false;

the value is already retrieved from cache...

Can anyone see a reason *not* to put that change in also? We just don't
advertise it as the "suggested" route to gaining performance, nor would
we rely on it for pg_dump/restore performance. 

Best Regards, Simon Riggs



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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [Bizgres-general] WAL bypass for INSERT, UPDATE and
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: [Bizgres-general] WAL bypass for INSERT, UPDATE and