Re: A 154 GB table swelled to 527 GB on the Slony slave. How to compact it? - Mailing list pgsql-general

From Alban Hertroys
Subject Re: A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?
Date
Msg-id 6602E48C-D15F-446E-ABEB-A0B5BD2C4AEA@gmail.com
Whole thread Raw
In response to Re: A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?  (Aleksey Tsalolikhin <atsaloli.tech@gmail.com>)
List pgsql-general
On 16 Mar 2012, at 20:20, Aleksey Tsalolikhin wrote:

> CLUSTER requires free space at least equal to the sum of the table
> size and the index sizes.
>
> pg_reorg rquires amount of space twice larger than target table and indexes.
>
> Too bad I can't say "CLUSTER TABLE tablename USING_ARRAY
> /dev/temp/array" or something
> like that, using an external array for temporary storage just for the
> cluster.  I do have an external
> USB drive with more than enough free space on it.


You could move the table to a different TABLESPACE, namely one on that USB disk. I'm not particular to the intrinsics
oftablespaces, but it's possible that moving it would trigger a rewrite of the contents such that the effect would be
similarto what CLUSTER would do for you - it probably just moves the files though, in which case you'd perform the
CLUSTERon the new TABLESPACE and then move it back. 

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Temporal foreign keys
Next
From: prem tolani
Date:
Subject: Query