Received: from mail.tgd.net (mail.tgd.net [209.81.25.10]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0RJVjl41473 for ; Sun, 27 Jan 2002 14:31:46 -0500 (EST) (envelope-from sean@mail.tgd.net) Received: by mail.tgd.net (Postfix, from userid 1001) id 814EE20F0A; Sun, 27 Jan 2002 11:31:40 -0800 (PST) Date: Sun, 27 Jan 2002 11:31:40 -0800 From: Sean Chittenden To: hubert depesz lubaczewski Cc: pgsql-admin@postgresql.org Subject: Re: INSERT performace. Message-ID: <20020127113140.A64594@ninja1.internal> References: <00a001c1a6d7$c833c520$7401a8c0@Home> <20020127091703.A16784@depesz.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020127091703.A16784@depesz.pl>; from "depesz@depesz.pl" on Sun, Jan 27, 2002 at = 09:17:04AM X-PGP-Key: 0x1EDDFAAD X-PGP-Fingerprint: C665 A17F 9A56 286C 5CFB 1DEA 9F4F 5CEF 1EDD FAAD X-Web-Homepage: http://sean.chittenden.org/ X-Archive-Number: 200201/209 X-Sequence-Number: 3093 > > We have a fresh database and have begun to observe performance > > degradation for INSERTs as a table went from empty to 100,000-ish > > rows. Initial INSERTs were sub second while after 30k rows, they > > were 1-3 seconds. > > we just hit this problem when moving old database to new one (new > schema). we had to insert approx. 1.5 million rows, and from > initial 0.02s/insert after several thousands of inserts it came to > 20 seconds per insert. what we did was removing foreign keys from > table which we made inserts to. it helped. we manage to put 300k > records in ca. 2-3 hours. If possible, use the COPY command. We did 90K rows in about 40sec using this puppy on a Solaris U5 (took over 130sec for MySQL on the same box in case the performance geeks in the crowd are interested). http://www.postgresql.org/idocs/index.php?sql-copy.html -sc -- Sean Chittenden