X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 809C3D1C4E1 for ; Wed, 6 Aug 2003 06:48:48 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 93887-01 for ; Wed, 6 Aug 2003 03:47:28 -0300 (ADT) Received: from fuji.krosing.net (silmet.estpak.ee [194.126.97.78]) by svr1.postgresql.org (Postfix) with ESMTP id CC9A9D1C4C1 for ; Wed, 6 Aug 2003 03:48:36 -0300 (ADT) Received: from fuji.krosing.net (localhost.localdomain [127.0.0.1]) by fuji.krosing.net (8.12.8/8.12.8) with ESMTP id h766gYaB004687; Wed, 6 Aug 2003 09:42:34 +0300 Received: (from hannu@localhost) by fuji.krosing.net (8.12.8/8.12.8/Submit) id h766gXc6004685; Wed, 6 Aug 2003 09:42:33 +0300 X-Authentication-Warning: fuji.krosing.net: hannu set sender to hannu@tm.ee using -f Subject: Re: How Many Inserts Per Transactions From: Hannu Krosing To: Trevor Astrope Cc: pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1060152153.4517.9.camel@fuji.krosing.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 06 Aug 2003 09:42:33 +0300 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/93 X-Sequence-Number: 2910 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