pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@tm.ee>
To: Trevor Astrope <astrope@e-corp.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: How Many Inserts Per Transactions
Date: 06 Aug 2003 09:42:33 +0300
Message-ID: <1060152153.4517.9.camel@fuji.krosing.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0308051155100.14944-100000@gord.tabbweb.com>
References: <Pine.LNX.4.44.0308051155100.14944-100000@gord.tabbweb.com>

Trevor Astrope kirjutas T, 05.08.2003 kell 18:59:
> I was wondering if anyone found a sweet spot regarding how many inserts to 
> do in a single transaction to get the best performance? Is there an 
> approximate number where there isn't any more performance to be had or 
> performance may drop off?
> 
> It's just a general question...I don't have any specific scenario, other
> than there are multiple backends doing many inserts.

I did test on huge (up to 60 million rows) simple table (5 fields with
primary key) and found that at that size many inserts per transaction
was actually a little slower than single inserts. It probably had to do
with inserting/checking new index entries and moving index pages from/to
disk. 

With small sizes or no index ~100 inserts/transaction was significantly
faster though.

I did run several (10-30) backends in parallel.

The computer was quad Xeon with 2GB RAM and ~50 MB/sec RAID.

------------------
Hannu




view thread (5+ messages)  latest in thread

Message-ID: <1060152153.4517.9.camel@fuji.krosing.net>
Permalink:  ../1060152153.4517.9.camel@fuji.krosing.net/
Also on:    postgresql.org/message-id/1060152153.4517.9.camel@fuji.krosing.net

 · 

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: hannu@tm.ee, astrope@e-corp.net
  Subject: Re: How Many Inserts Per Transactions
  In-Reply-To: <1060152153.4517.9.camel@fuji.krosing.net>
  References: <Pine.LNX.4.44.0308051155100.14944-100000@gord.tabbweb.com> <1060152153.4517.9.camel@fuji.krosing.net>

* 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