Re: Reduce WAL logging of INSERT SELECT

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Reduce WAL logging of INSERT SELECT
Дата
Msg-id 1312505628.22189.6.camel@jdavis-ux.asterdata.local
обсуждение исходный текст
Ответ на Re: Reduce WAL logging of INSERT SELECT  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Reduce WAL logging of INSERT SELECT  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
On Thu, 2011-08-04 at 17:46 -0400, Bruce Momjian wrote:
> Right.  I brought up SELECT INTO because you could make the argument
> that INSERT ... SELECT is not a utility command like the other ones and
> therefore can't be done easily, but CREATE TABLE AS is internal SELECT
> INTO and implemented in execMain.c, which I think is where INSERT ...
> SELECT would also be implemented.

The above statement is a little confusing, so let me start from the
beginning:

How could we avoid WAL logging for INSERT ... SELECT?

The way we do it for CREATE TABLE AS is because nobody would even *see*
the table if our transaction doesn't commit. Therefore we don't need to
bother logging it. Same can be said for SELECT INTO.

INSERT ... SELECT is just an insert. It needs just as much logging as
inserting tuples any other way. For instance, it will potentially share
pages with other inserts, and better properly record all such page
modifications so that they return to a consistent state.

Regards,Jeff Davis





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

Предыдущее
От: Alex Hunsaker
Дата:
Сообщение: Re: plperl crash with Debian 6 (64 bit), pl/perlu, libwww and https
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Reduce WAL logging of INSERT SELECT