pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steve Bergman <steve@rueb.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimizing for writes. Data integrity not critical
Date: Thu, 19 May 2005 19:45:01 -0400
Message-ID: <10301.1116546301@sss.pgh.pa.us> (raw)
In-Reply-To: <20050519222731.GB20142@uio.no>
References: <428D1153.1020109@rueb.com>
	<20050519222731.GB20142@uio.no>

"Steinar H. Gunderson" <sgunderson@bigfoot.com> writes:
> On Thu, May 19, 2005 at 05:21:07PM -0500, Steve Bergman wrote:
>> I'm doing the writes individually.  Is there a better way?  Combining 
>> them all into a transaction or something?

> Batching them all in one or a few transactions will speed it up a _lot_.
> Using COPY would help a bit more on top of that.

Also, if you really don't need to worry about data integrity, turning
off fsync in the config file will probably help.  (Though since it's
an IDE drive, maybe not, as the drive may be lying about write complete
anyway.)

Increasing checkpoint_segments will help too, at the cost of disk space
(about 32MB per increment in the value, IIRC).  I'd suggest pushing it
up enough so you don't incur a checkpoint while the time-critical
operation runs.  checkpoint_timeout may be too small too.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <10301.1116546301@sss.pgh.pa.us>
Permalink:  ../10301.1116546301@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10301.1116546301@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, steve@rueb.com
  Subject: Re: Optimizing for writes. Data integrity not critical
  In-Reply-To: <10301.1116546301@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox