Re: Why is unique constraint needed for upsert? (treat atomicity as optional)

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: Why is unique constraint needed for upsert? (treat atomicity as optional)
Дата
Msg-id 1406150492812-5812628.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: Why is unique constraint needed for upsert? (treat atomicity as optional)  (Seamus Abshere <seamus@abshere.net>)
Список pgsql-general
seamusabshere wrote
>> At READ COMMITTED isolation level, you should always get an atomic insert
>> or update [1]
>
> I just think there are a lot of non-concurrent bulk loading and
> processing workflows that could benefit from the performance advantages
> of upsert (one trip to database).

Bulk load raw data into UNLOGGED staging table
LOCK production table
UPDATE matched records
INSERT unmatched records
UNLOCK production table
TRUNCATE staging table

This seems like it would be sufficient for "non-concurrent bulk loading"...

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Why-is-unique-constraint-needed-for-upsert-tp5812552p5812628.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: Seamus Abshere
Дата:
Сообщение: Re: Why is unique constraint needed for upsert? (treat atomicity as optional)
Следующее
От: David G Johnston
Дата:
Сообщение: Re: Why is unique constraint needed for upsert? (treat atomicity as optional)