Re: Inserting heap tuples in bulk in COPY

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Inserting heap tuples in bulk in COPY
Дата
Msg-id 4E708759.40206@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Inserting heap tuples in bulk in COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Inserting heap tuples in bulk in COPY
Re: Inserting heap tuples in bulk in COPY
Список pgsql-hackers
On 13.08.2011 17:33, Tom Lane wrote:
> Heikki Linnakangas<heikki.linnakangas@enterprisedb.com>  writes:
>> The patch is WIP, mainly because I didn't write the WAL replay routines
>> yet, but please let me know if you see any issues.
>
> Why do you need new WAL replay routines?  Can't you just use the existing
> XLOG_HEAP_NEWPAGE support?
>
> By any large, I think we should be avoiding special-purpose WAL entries
> as much as possible.

I tried that, but most of the reduction in WAL-size melts away with
that. And if the page you're copying to is not empty, logging the whole
page is even more expensive. You'd need to fall back to retail inserts
in that case which complicates the logic.

> Also, I strongly object to turning regular heap_insert into a wrapper
> around some other more complicated operation.  That will likely have
> bad consequences for the performance of every other operation.

Ok. I doubt it makes any noticeable difference for performance, but
having done that, it's more readable, too, to duplicate the code.

Attached is a new version of the patch. It is now complete, including
WAL replay code.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: unite recovery.conf and postgresql.conf
Следующее
От: Kaare Rasmussen
Дата:
Сообщение: Re: What Would You Like To Do?