pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: scott.marlowe <scott.marlowe@ihs.com>
To: Kevin White <kwhite@digital-ics.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Really bad insert performance: what did I do wrong?
Date: Fri, 21 Feb 2003 10:55:41 -0700 (MST)
Message-ID: <Pine.LNX.4.33.0302211049090.17876-100000@css120.ihs.com> (raw)
In-Reply-To: <3E566022.5010200@digital-ics.com>

OK, I'm gonna make a couple of observations here that may help out.

1:  sun's performance on IDE hardware is abysmal.  Both Solaris X86 and 
Solaris Sparc are utter dogs at IDE, even when you do get DMA and prefetch 
setup and running.  Linux or BSD are much much better at handling IDE 
interfaces.

2:  Postgresql under Solaris on Sparc is about 1/2 as fast as Postgresql 
under Linux on Sparc, all other things being equal.  On 32 bith Sparc the 
chasm widens even more.

3:  Inserting ALL 700,000 rows in one transaction is probably not optimal.  
Try putting a test in every 1,000 or 10,000 rows to toss a "commit;begin;" 
pair at the database while loading.  Inserting all 700,000 rows at once 
means postgresql can't recycle the transaction logs, so you'll have 
700,000 rows worth of data in the transaction logs waiting for you to 
commit at the end.  That's a fair bit of space, and a large set of files 
to keep track of.  My experience has been that anything over 1,000 inserts 
in a transaction gains little.

4:  If you want to make sure you don't insert any duplicates, it's 
probably faster to use a unique multi-column key on all your columns 
(there's a limit on columns in an index depending on which flavor of 
postgresql you are running, but I think it's 16 on 7.2 and before and 32 
on 7.3 and up.  I could be off by a factor of two there.





view thread (11+ messages)  latest in thread

Message-ID: <Pine.LNX.4.33.0302211049090.17876-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0302211049090.17876-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0302211049090.17876-100000@css120.ihs.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: scott.marlowe@ihs.com, kwhite@digital-ics.com
  Subject: Re: Really bad insert performance: what did I do wrong?
  In-Reply-To: <Pine.LNX.4.33.0302211049090.17876-100000@css120.ihs.com>
  References: <3E566022.5010200@digital-ics.com> <Pine.LNX.4.33.0302211049090.17876-100000@css120.ihs.com>

* 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