Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6B4939F9EF0 for ; Tue, 6 Feb 2007 01:33:39 -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 99648-02 for ; Tue, 6 Feb 2007 01:33:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D18C49F98D3 for ; Tue, 6 Feb 2007 01:33:36 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l165XZeY029907; Tue, 6 Feb 2007 00:33:36 -0500 (EST) To: "Karen Hill" cc: pgsql-performance@postgresql.org Subject: Re: How long should it take to insert 200,000 records? In-reply-to: <1170722158.973141.208230@j27g2000cwj.googlegroups.com> References: <1170722158.973141.208230@j27g2000cwj.googlegroups.com> Comments: In-reply-to "Karen Hill" message dated "05 Feb 2007 16:35:59 -0800" Date: Tue, 06 Feb 2007 00:33:35 -0500 Message-ID: <29906.1170740015@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/56 X-Sequence-Number: 23110 "Karen Hill" writes: > 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? I think you have omitted a bunch of relevant facts. Bare INSERT is reasonably quick: regression=# create table foo (f1 int); CREATE TABLE regression=# \timing Timing is on. regression=# insert into foo select x from generate_series(1,200000) x; INSERT 0 200000 Time: 5158.564 ms regression=# (this on a not-very-fast machine) but if you weigh it down with a ton of index updates, foreign key checks, etc, it could get slow ... also you haven't mentioned what else that plpgsql function is doing. regards, tom lane