create index in parallel?

From: "Angva" <angvaw(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: create index in parallel?
Date: 2006-09-15 22:17:38
Message-ID: 1158358658.275038.168840@e3g2000cwe.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, looking for a little advice...

Nightly, I run a script that does the following (in a nutshell): drop
most of the indexes in a particular schema; load a large amount of data
into this schema; finally recreate the indexes.

The create index process seems to be CPU-bound. The server has four
CPUs but postmaster is only using one. Is there a way to tell Postgres
to build in parallel? For instance in Oracle one can run the following
to have four processes build an index in parallel:

CREATE INDEX emp_ix ON emp (emp_id)
PARALLEL (DEGREE 4);

I could always create each index from a separate script in parallel,
but that would be less flexible (can't easily modify degree for
instance) and take some serious redesign... No luck searching the docs,
but I'd just like to be sure that there isn't such a feature... Or if
there's a better way to tackle this problem I'd love to hear it.

So, any input would be appreciated.

Thanks,
Mark

Browse pgsql-general by date

  From Date Subject
Next Message Poul Jensen 2006-09-15 22:44:33 Re: ECPG: non-integer constant in group by
Previous Message Michael Fuhr 2006-09-15 21:00:47 Re: create table as problem