In COPY, insert tuples to the heap in batches.

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: d326d9e8ea1d690cf6d968000efaa5121206d231
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2011-11-09T08:54:41Z
Releases: 9.2.0
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.

Files

PathChange+/−
src/backend/access/heap/heapam.c modified +439 −45
src/backend/commands/copy.c modified +153 −13
src/backend/postmaster/pgstat.c modified +3 −3
src/include/access/heapam.h modified +2 −0
src/include/access/htup.h modified +31 −0
src/include/pgstat.h modified +1 −1