Tom Lane wrote:
>
> Hannu Krosing <[EMAIL PROTECTED]> writes:
> > Just out of curiosity - does CLUSTER currently "practically rebuild
> > a tables representation" ?
>
> CLUSTER currently *loses* most of a table's representation :-(.
> It needs work.
The easiest implememntaion of CLUSTER seems to be something along the
lines of
-- lock original table for WRITE in all backends
CREATE TABLE CLUSTERED_T
AS
SELECT * FROM ORIGINAL_T ORDER BY INDEX_COLUMNS;
-- now do a move of CLUSTERED_T -> ORIGINAL_T
-- and then REINDEX
-- flush cache in all backends
-- unlock the altered table
This would need an actual 2xSIZE + size of dead tuples of space but
would
probably be fastest in situations where heavy rearrangement is needed.
> But since the whole point of CLUSTER is to physically rearrange the
> tuples of a table, it seems to me that it's in a different category
> from VACUUM anyway.
OTOH it is the closest thing to VACUUM among "standard" SQL commands ;)
-----------------
Hannu
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly