Re: Inserting heap tuples in bulk in COPY

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Inserting heap tuples in bulk in COPY
Дата
Msg-id CA+TgmobMw0SbDysnyw05NTViWZGrv3DL+_7innH7HP=N3M44ig@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Inserting heap tuples in bulk in COPY  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Inserting heap tuples in bulk in COPY
Re: Inserting heap tuples in bulk in COPY
Список pgsql-hackers
On Tue, Aug 7, 2012 at 4:52 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> Incidentally, we can also optimise repeated inserts within a normal
> transaction using this method, by implementing deferred unique
> constraints. At present we say that unique constraints aren't
> deferrable, but there's no reason they can't be, if we allow buffering
> in the index. (Implementing a deferred constraint that won't fail if
> we do UPDATE foo SET pk = pk+1 requires a buffer the size of foo,
> which is probably a bad plan, plus you'd need to sort the inputs, so
> that particular nut is another issue altogether, AFAICS).

We've had deferrable unique constraints since 9.0, courtesy of Dean Rasheed.

> I think we need to implement buffering both to end of statement or end
> of transaction, not just one or the other.

Another (not necessarily better) idea is to use a buffer that's part
of the index, like the GIN fastupdate stuff, so that there's no
particular constraint on when the buffer has to be flushed, but
competing index scans may be slower until it is.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Git diff patch in context diff format
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Inserting heap tuples in bulk in COPY