Re: CLUSTER patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)atentus(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: CLUSTER patch
Date: 2002-07-14 16:58:19
Message-ID: 19224.1026665899@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Alvaro Herrera <alvherre(at)atentus(dot)com> writes:
> The way the cluster is done is still the same: first cluster the heap
> and swap relfilenodes, then drop old heap; then rebuild each index, swap
> relfilenodes with old index and drop new.

I do not see anything in this patch that touches relfilenode. Perhaps
the patch is incomplete?

> But as soon as I try to do anything to it (the new,
> clustered filenode) before transaction commit (building an index, say),
> the local buffer manager fails an assertion (actually,
> RelationNodeCacheGetRelation returns 0 for the given rnode), and the
> transaction aborts.

Hmm. If you do the swap in the correct way (viz, update the relation's
pg_class entry and then CommandCounterIncrement) I'd expect the relcache
to respond correctly. This does involve re-indexing the relcache entry
under a new relfilenode value, but that's not significantly different
from the case of renaming a relation.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-07-14 17:03:02 Re: CLUSTER patch
Previous Message Bruce Momjian 2002-07-14 06:42:53 Re: CLUSTER patch