Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0
Дата
Msg-id 551A8E88.8030403@iki.fi
обсуждение исходный текст
Ответ на Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0  (Peter Geoghegan <pg@heroku.com>)
Список pgsql-hackers
On 03/30/2015 07:20 PM, Peter Geoghegan wrote:
>
>> >* I think we should decouple the insertion and wal logging more. I think
>> >   the promise tuple insertion should be different from the final
>> >   insertion of the actual tuple. For one it seems cleaner to me, for
>> >   another it will avoid the uglyness around logical decoding. I think
>> >   also that the separation will make it more realistic to use something
>> >   like this for a COPY variant that doesn't raise unique violations and
>> >   such.
> Your COPY argument swung this for me. I'm looking into the implementation.

I'm pretty sceptical of that. ISTM you'll need to do modify the page 
twice for each insertion, first to insert the promise tuple, and then to 
turn the promise tuple into a real tuple. And WAL-log both updates. 
That's going to hurt performance.

To recover COPY from unique violations, you can just do the same as 
INSERT ON CONFLICT IGNORE does, and super-delete the inserted tuple on 
conflict. To recover from any random error, you'll need to abort the 
(sub)transaction anyway, and I don't see how it helps to separate the 
insertion of the promise tuple and the "finalization" of the insertion.

- Heikki




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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: WIP: SCRAM authentication
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Cleanup double semicolons at the end of source lines