pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Matthew <matthew@flymine.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: 7 hrs for a pg_restore?
Date: Wed, 20 Feb 2008 10:35:32 -0800
Message-ID: <1203532532.3846.158.camel@dogma.ljc.laika.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0802201811330.20402@aragorn.flymine.org>
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>
	<Pine.LNX.4.64.0802201811330.20402@aragorn.flymine.org>

On Wed, 2008-02-20 at 18:18 +0000, Matthew wrote:
> On Wed, 20 Feb 2008, Jeff Davis wrote:
> > However, building indexes in parallel would allow better CPU
> > utilization.
> 
> 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.

What was the specific problem? Were they UNIQUE indexes? Were you trying
to write to the tables while indexing? Did you use "CONCURRENTLY"?

Regards,
	Jeff Davis




view thread (42+ messages)  latest in thread

Message-ID: <1203532532.3846.158.camel@dogma.ljc.laika.com>
Permalink:  ../1203532532.3846.158.camel@dogma.ljc.laika.com/
Also on:    postgresql.org/message-id/1203532532.3846.158.camel@dogma.ljc.laika.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: pgsql@j-davis.com, matthew@flymine.org
  Subject: Re: 7 hrs for a pg_restore?
  In-Reply-To: <1203532532.3846.158.camel@dogma.ljc.laika.com>
  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> <Pine.LNX.4.64.0802201811330.20402@aragorn.flymine.org> <1203532532.3846.158.camel@dogma.ljc.laika.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox