Re: COPY and heap_sync

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: COPY and heap_sync
Дата
Msg-id CA+Tgmoa3VXCx9GKAON1_FkVcG6_-uo6=S+fL0zj8N2dVTTBptA@mail.gmail.com
обсуждение исходный текст
Ответ на COPY and heap_sync  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-hackers
On Sat, Aug 30, 2014 at 2:26 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> If you insert tuples with COPY into a table created or truncated in the same
> transaction, at the end of the COPY it calls heap_sync.
>
> But there cases were people use COPY in a loop with a small amount of data
> in each statement.  Now it is calling heap_sync many times, and if NBuffers
> is large doing that gets very slow.
>
> Could the heap_sync be safely delayed until the end of the transaction,
> rather than the end of the COPY?

I don't think there's any data integrity problem with that, but if the
fsync() should fail it would be reported at commit time rather than in
response to the COPY.  That might be OK though.

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



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: postgresql latency & bgwriter not doing its job
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}