Re: How Many Inserts Per Transactions

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Trevor Astrope <astrope(at)e-corp(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: How Many Inserts Per Transactions
Date: 2003-08-06 06:42:33
Message-ID: 1060152153.4517.9.camel@fuji.krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Yaroslav Mazurak 2003-08-06 07:34:54 PostgreSQL performance problem -> tuning
Previous Message Neil Conway 2003-08-06 05:35:52 Re: Some vacuum & tuning help