Thread: pgsql: In COPY, insert tuples to the heap in batches.

pgsql: In COPY, insert tuples to the heap in batches.

From
Heikki Linnakangas
Date:
In COPY, insert tuples to the heap in batches.

This greatly reduces the WAL volume, especially when the table is narrow.
The overhead of locking the heap page is also reduced. Reduced WAL traffic
also makes it scale a lot better, if you run multiple COPY processes at
the same time.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d326d9e8ea1d690cf6d968000efaa5121206d231

Modified Files
--------------
src/backend/access/heap/heapam.c |  484 ++++++++++++++++++++++++++++++++++----
src/backend/commands/copy.c      |  166 ++++++++++++-
src/backend/postmaster/pgstat.c  |    6 +-
src/include/access/heapam.h      |    2 +
src/include/access/htup.h        |   31 +++
src/include/pgstat.h             |    2 +-
6 files changed, 629 insertions(+), 62 deletions(-)