Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0FED39FB25B for ; Tue, 6 Feb 2007 12:55:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 47142-01 for ; Tue, 6 Feb 2007 12:55:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id CE8659FB1E6 for ; Tue, 6 Feb 2007 12:55:54 -0400 (AST) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Tue, 6 Feb 2007 16:55:53 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 06 Feb 2007 10:55:53 -0600 Subject: Re: How long should it take to insert 200,000 records? From: Scott Marlowe To: Merlin Moncure Cc: Karen Hill , pgsql-performance@postgresql.org In-Reply-To: References: <1170722158.973141.208230@j27g2000cwj.googlegroups.com> <1170778484.5451.97.camel@state.g2switchworks.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1170780953.5451.99.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 06 Feb 2007 10:55:53 -0600 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/68 X-Sequence-Number: 23122 On Tue, 2007-02-06 at 10:40, Merlin Moncure wrote: > On 2/6/07, Scott Marlowe wrote: > > On Mon, 2007-02-05 at 18:35, Karen Hill wrote: > > > I have a pl/pgsql function that is inserting 200,000 records for > > > testing purposes. What is the expected time frame for this operation > > > on a pc with 1/2 a gig of ram and a 7200 RPM disk? The processor is > > > a 2ghz cpu. So far I've been sitting here for about 2 million ms > > > waiting for it to complete, and I'm not sure how many inserts postgres > > > is doing per second. > > > > That really depends. Doing 200,000 inserts as individual transactions > > will be fairly slow. Since PostgreSQL generally runs in autocommit > > mode, this means that if you didn't expressly begin a transaction, you > > are in fact inserting each row as a transaction. i.e. this: > > I think OP is doing insertion inside a pl/pgsql loop...transaction is > implied here. Yeah, I noticed that about 10 seconds after hitting send... :)