Received: from mgc.pl-1to1-Magic (neron.mgc.pl [213.173.203.154]) by postgresql.org (8.11.3/8.11.4) with SMTP id g0R8HGl60885 for ; Sun, 27 Jan 2002 03:17:16 -0500 (EST) (envelope-from depesz@depesz.pl) Received: (qmail 16795 invoked by uid 500); 27 Jan 2002 08:17:04 -0000 Date: Sun, 27 Jan 2002 09:17:04 +0100 From: hubert depesz lubaczewski To: pgsql-admin@postgresql.org Subject: Re: INSERT performace. Message-ID: <20020127091703.A16784@depesz.pl> Reply-To: depesz@depesz.pl References: <00a001c1a6d7$c833c520$7401a8c0@Home> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <00a001c1a6d7$c833c520$7401a8c0@Home> User-Agent: Mutt/1.3.23i X-info-en-1: this message *may* reflect my personal opinion. it is *not* X-info-en-2: intended to reflect those of my employer, or anyone else. X-info-pl-1: wszelkie opinie =?iso-8859-2?Q?wyra=BFone_?= =?iso-8859-2?Q?w_tym_li=B6cie_prezentuj=B1_wy=B3=B1cznie_pogl=B1dy?= X-info-pl-2: autora listu. opinie =?iso-8859-2?Q?te_?= =?iso-8859-2?Q?w_=BFadnym__razie_nie__wyra=BFaj=B1__pogl=B1d=F3w?= X-info-pl-3: pracodawcy autora =?iso-8859-2?Q?listu_?= =?iso-8859-2?Q?_ani__innych__zwi=B1zanych__z__nim__os=F3b=2E?= X-Operating-System: Linux 2.4.16 i686 pld X-Archive-Number: 200201/208 X-Sequence-Number: 3092 On Sat, Jan 26, 2002 at 08:10:19PM -0600, Marc Mitchell wrote: > 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. depesz -- hubert depesz lubaczewski http://www.depesz.pl/ ------------------------------------------------------------------------ ... vows are spoken to be broken ... [enjoy the silence] ... words are meaningless and forgettable ... [depeche mode]