Re: CLUSTER not lose indexes

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: CLUSTER not lose indexes
Date: 2002-07-05 06:28:47
Message-ID: Pine.LNX.4.44.0207050216160.19948-200000@cm-lcon-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane dijo:

> I think you probably want a CommandCounterIncrement at the bottom of the
> loop (after setRelhasindex). If it works as-is it's just by chance,
> ie due to internal CCI calls in index_create.

Done.

> + tuple = SearchSysCache(RELOID, ObjectIdGetDatum(attrs->indexOID),
> + 0, 0, 0);
> + if (!HeapTupleIsValid(tuple))
> + break;
>
> Breaking out of the loop hardly seems an appropriate response to this
> failure condition. Not finding the index' pg_class entry is definitely
> an error.

Sure. elog(ERROR) now. I'm not sure what was I thinking when I wrote
that.

> I'd also suggest more-liberal commenting, as well as more attention to
> updating the existing comments to match new reality.

I'm afraid I cannot get too verbose no matter how hard I try. I hope
this one is OK.

> In general, I'm not thrilled about expending more code on the existing
> fundamentally-broken implementation of CLUSTER. We need to look at
> making use of the ability to write a new version of a table (or index)
> under a new relfilenode value, without changing the table's OID.
> However, some parts of your patch will probably still be needed when
> someone gets around to making that happen, so I won't object for now.

Will try to do this.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
Licensee shall have no right to use the Licensed Software
for productive or commercial use. (Licencia de StarOffice 6.0 beta)

Attachment Content-Type Size
cluster.patch text/plain 6.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2002-07-05 06:36:41 Proposal: CREATE CONVERSION
Previous Message Christopher Kings-Lynne 2002-07-05 06:28:04 Re: BETWEEN Node & DROP COLUMN

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-07-05 14:27:05 Re: CLUSTER not lose indexes
Previous Message Bruce Momjian 2002-07-05 05:45:09 Re: CLUSTER not lose indexes