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 07:31:34
Message-ID: BANLkTinW9ocFW6A6VQy4Q1GyzUTotTUwNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, Apr 10, 2011 at 11:35 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:
> 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.

Same error on pg 8.4.6

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2011-04-11 07:41:24 Re: Multiple index builds on same table - in one sweep?
Previous Message Scott Marlowe 2011-04-11 05:35:49 Re: Multiple index builds on same table - in one sweep?