Skip site navigation (1) Skip section navigation (2)

Re: Bulk Insert tuning

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: Bulk Insert tuning
Date: 2008-02-26 19:08:03
Message-ID: 1204052883.4252.417.camel@ebony.site (view raw or flat)
Thread:
Lists: pgsql-patches
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 


In response to

pgsql-patches by date

Next:From: Gevik BabakhaniDate: 2008-02-26 19:09:37
Subject: Re: lc_time and localized dates
Previous:From: Gevik BabakhaniDate: 2008-02-26 18:53:42
Subject: Re: lc_time and localized dates

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group