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

Re: Optimizing for writes. Data integrity not critical

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Bergman <steve(at)rueb(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimizing for writes. Data integrity not critical
Date: 2005-05-19 23:45:01
Message-ID: 10301.1116546301@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Steinar H. Gunderson" <sgunderson(at)bigfoot(dot)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

In response to

pgsql-performance by date

Next:From: Christopher Kings-LynneDate: 2005-05-20 01:45:42
Subject: Re: Optimizing for writes. Data integrity not critical
Previous:From: Steinar H. GundersonDate: 2005-05-19 22:27:31
Subject: Re: Optimizing for writes. Data integrity not critical

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