Re: Multiple index builds on same table - in one sweep?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Multiple index builds on same table - in one sweep?
Date: 2011-04-11 05:35:49
Message-ID: BANLkTinTWXOKd6QunwBag1AJypYTVjYxRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, Apr 10, 2011 at 8:29 PM, Greg Smith <greg(at)2ndquadrant(dot)com> wrote:
> On 04/09/2011 01:23 PM, Chris Ruprecht wrote:
>>
>> Maybe, in a future release, somebody will develop something that can
>> create indexes as inactive and have a build tool build and activate them at
>> the same time. Food for thought?
>>
>
> Well, the most common case where this sort of thing happens is when people
> are using pg_restore to load a dump of an entire database.  In that case,
> you can use "-j" to run more than one loader job in parallel, which can
> easily end up doing a bunch of index builds at once, particularly at the
> end.  That already works about as well as it can because of the synchronized
> scan feature Tom mentioned.

FYI, in 8.3.13 I get this for all but one index:

ERROR: deadlock detected
DETAIL: Process 24488 waits for ShareLock on virtual transaction
64/825033; blocked by process 27505.
Process 27505 waits for ShareUpdateExclusiveLock on relation 297369165
of database 278059474; blocked by process 24488.

I'll try it on a big server running 8.4 and see what happens.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2011-04-11 07:31:34 Re: Multiple index builds on same table - in one sweep?
Previous Message Greg Smith 2011-04-11 02:40:48 Re: optimizer parameters