Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id B28899FA434 for ; Tue, 6 Mar 2007 03:40:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 08182-01 for ; Tue, 6 Mar 2007 03:40:44 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 5B3469FA312 for ; Tue, 6 Mar 2007 03:40:51 -0400 (AST) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 1253175601; Tue, 6 Mar 2007 07:34:47 +0000 (GMT) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id E5C1C2740D9; Tue, 6 Mar 2007 07:34:46 +0000 (GMT) Message-ID: <45ED1996.7050008@archonet.com> Date: Tue, 06 Mar 2007 07:34:46 +0000 From: Richard Huxton User-Agent: IceDove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: hatman Cc: pgsql-performance@postgresql.org Subject: Re: Insert performance References: <1172596221.393824.41130@j27g2000cwj.googlegroups.com> In-Reply-To: <1172596221.393824.41130@j27g2000cwj.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.208 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200703/120 X-Sequence-Number: 23525 hatman wrote: > Dear all, > > After many tests and doc reading, i finally try to get help from > you... > > Here is my problem. With some heavy insert into a simple BD (one > table, no indexes) i can't get better perf than 8000 inserts/sec. I'm > testing it using a simple C software which use libpq and which use: > - Insert prepared statement (to avoid too many request parsing on the > server) > - transaction of 100000 inserts Are each of the INSERTs in their own transaction? If so, you'll be limited by the speed of the disk the WAL is running on. That means you have two main options: 1. Have multiple connections inserting simultaneously. 2. Batch your inserts together, from 10 to 10,000 per transaction. Are either of those possible? -- Richard Huxton Archonet Ltd