Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B47DC2E0044 for ; Wed, 20 Feb 2008 14:47:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 60174-03-4 for ; Wed, 20 Feb 2008 14:46:59 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 279962E007D for ; Wed, 20 Feb 2008 14:46:59 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m1KIkt03014183; Wed, 20 Feb 2008 13:46:55 -0500 (EST) To: Matthew cc: pgsql-performance@postgresql.org Subject: Re: 7 hrs for a pg_restore? In-reply-to: References: <200802191303.58840.doug@hunley.homeip.net> <1203445403.3846.86.camel@dogma.ljc.laika.com> <2e78013d0802200101q44dbe6edvac067c39629ed9cd@mail.gmail.com> <1203530687.3846.151.camel@dogma.ljc.laika.com> Comments: In-reply-to Matthew message dated "Wed, 20 Feb 2008 18:18:23 +0000" Date: Wed, 20 Feb 2008 13:46:55 -0500 Message-ID: <14182.1203533215@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/256 X-Sequence-Number: 28798 Matthew writes: > We have a process here that dumps a large quantity of data into an empty > database, much like pg_restore, and then creates all the indexes at the > end. In order to speed up that bit, I initially made it spawn off several > threads, and make each thread run a CREATE INDEX operation in parallel. > However, this resulted in random errors from Postgres - something to do > with locked tables. So I changed it so that no two threads create indexes > for the same table at once, and that solved it. How long ago was that? There used to be some issues with two CREATE INDEXes both trying to update the pg_class row, but I thought we'd fixed it. regards, tom lane