Re: How Many Inserts Per Transactions - Mailing list pgsql-performance

From Hannu Krosing
Subject Re: How Many Inserts Per Transactions
Date
Msg-id 1060152153.4517.9.camel@fuji.krosing.net
Whole thread Raw
In response to How Many Inserts Per Transactions  (Trevor Astrope <astrope@e-corp.net>)
List 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


pgsql-performance by date:

Previous
From: Neil Conway
Date:
Subject: Re: Some vacuum & tuning help
Next
From: Yaroslav Mazurak
Date:
Subject: PostgreSQL performance problem -> tuning