On Tue, 2008-02-26 at 14:43 +0000, Simon Riggs wrote:
> Following patch implements a simple mechanism to keep a buffer pinned
> while we are bulk loading.
>
> Performance gains measured as +20% gain for CREATE TABLE as SELECT, and
> 15-17% for COPY on very short rows. Measurable difference drops away and
> is not measurable at all at 1000/bytes per row.
>
> As a result, patch doesn't bother to implement buffer pinning for TOAST
> operations.
Short guide for reviewers:
backend/access/heap/heapam.c | 47 +++++++++++++!!!!!!!!!!!!!!!!!!!!!
backend/access/heap/hio.c | 32 ++-!!!!!!!!!!!!!!!!!!!!!!
backend/access/heap/tuptoaster.c | 2 !
backend/access/transam/xact.c | 1
backend/commands/copy.c | 9 +++++!!
backend/executor/execMain.c | 9 !!!!!!!
backend/storage/buffer/bufmgr.c | 32 ++++++++++++++++++++++++++
include/access/heapam.h | 4 +!!
include/access/hio.h | 2 !
include/storage/bufmgr.h | 5 ++++
10 files changed, 66 insertions(+), 1 deletion(-), 76 modifications(!)
New heap API calls in heapam.c, caled from copy.c and execMain.c
Modified API to HeapGetBufferForTuple() in hio.c, causes changes
elsewhere in that file and tuptoaster.c
New buffer manager API to manage pinned buffer in bufmgr.c
Transaction cleanup on abort in xact.c
--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com