Re: CLUSTER and MVCC - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CLUSTER and MVCC
Date
Msg-id 29752.1173455897@sss.pgh.pa.us
Whole thread Raw
In response to CLUSTER and MVCC  (Heikki Linnakangas <heikki@enterprisedb.com>)
Responses Re: CLUSTER and MVCC  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas <heikki@enterprisedb.com> writes:
> Is there a particular reason why CLUSTER isn't MVCC-safe? It seems to me 
> that it would be trivial to fix, by using SnapshotAny instead of 
> SnapshotNow, and not overwriting the xmin/xmax with the xid of the 
> cluster command.

The reason it's not trivial is that you also have to preserve the t_ctid
links of update chains.  If you look into VACUUM FULL, a very large part
of its complexity is that it moves update chains as a unit to make that
possible.  (BTW, I believe the problem Pavan Deolasee reported yesterday
is a bug somewhere in there --- it looks to me like sometimes the same
update chain is getting copied multiple times.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: Calculated view fields (8.1 != 8.2)
Next
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Remove unsafe calling of WSAStartup and WSA Cleanup from DllMain.