COPY and heap_sync

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: COPY and heap_sync
Date: 2014-08-30 06:26:01
Message-ID: CAMkU=1z0YBPi6Svpji8WBd6vABVQ_+Opm2HyDnJQ07Y32av0-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

Cheers,

Jeff

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-08-30 06:52:26 Re: Misleading error message in logical decoding for binary plugins
Previous Message Amit Kapila 2014-08-30 03:27:27 Re: ALTER SYSTEM RESET?