create index in parallel? - Mailing list pgsql-general

From Angva
Subject create index in parallel?
Date
Msg-id 1158358658.275038.168840@e3g2000cwe.googlegroups.com
Whole thread Raw
List 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


pgsql-general by date:

Previous
From: "Junkone"
Date:
Subject: Re: remote duplicate rows
Next
From: "Weerts, Jan"
Date:
Subject: Re: Installation with sources or with packages