Re: Cluster using tablespaces? - Mailing list pgsql-general

From Rainer Bauer
Subject Re: Cluster using tablespaces?
Date
Msg-id epurk3pp6u5sva4vpc07klsfjuug2d8f4k@4ax.com
Whole thread Raw
In response to Cluster using tablespaces?  (Rainer Bauer <usenet@munnin.com>)
Responses Re: Cluster using tablespaces?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-general
Tom Lane wrote:

>Rainer Bauer <usenet@munnin.com> writes:
>
>> "During the cluster operation, a temporary copy of the table is created that
>> contains the table data in the index order. Temporary copies of each index on
>> the table are created as well."
>
>That's probably a bit misleading.  There is no "temporary" copy of the
>table, just the new permanent copy.  The document is trying to point out
>to you that the transient disk space requirement will be 2X the table
>size, but maybe we could phrase it better.

Ok, I expected that. Does this work:
ALTER TABLE foo CLUSTER ON index_name SET TABLESPACE new_tablespace

I.e. is the table moved to the other tablespace and clustered at the same time
or are these independant operations?

What I am trying to achieve is cutting down the time the cluster command
takes. I thought the most promising way would be if the new data is written to
different drive.

>For btree indexes, there is a temporary copy of the index data, which
>will go wherever you have arranged for temp files to go.  (I think that
>easy user control of this may be new for 8.3, though.)

Could you give me a hint where that would be on Windows? I guess this might be
worth a try since there are a couple of btree indexes in the database.

Rainer

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cluster using tablespaces?
Next
From: Ron Johnson
Date:
Subject: Re: PostgresSQL vs. Informix