Re: Building multiple indexes concurrently

From: Ben Chobot <bench(at)silentmedia(dot)com>
To: Rob Wultsch <wultsch(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Building multiple indexes concurrently
Date: 2010-03-17 05:13:27
Message-ID: C19B5368-4DE4-4CA9-B681-F80BA5837493@silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mar 16, 2010, at 6:04 PM, Rob Wultsch wrote:

> Lets say I have a large table bigTable to which I would like to add
> two btree indexes. Is there a more efficient way to create indexes
> than:
> CREATE INDEX idx_foo on bigTable (foo);
> CREATE INDEX idx_baz on bigTable (baz);
> Or
> CREATE INDEX CONCURRENTLY idx_foo on bigTable (foo);
> CREATE INDEX CONCURRENTLY idx_baz on bigTable (baz);
>
> Are there any particular performance optimizations that would be in
> play in such a scenario?
>
> At a minimum I assume that if both of the commands were started at
> about the same time they would each scan the table in the same
> direction and whichever creation was slower would benefit from most of
> the table data it needed being prepopulated in shared buffers. Is this
> the case?

That sounds reasonable to me. You might also look at upping your maintenance_work_mem for your session, as well.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Pierre C 2010-03-17 07:32:09 Re: Block at a time ...
Previous Message Rob Wultsch 2010-03-17 01:04:41 Building multiple indexes concurrently