CLUSTER not lose indexes

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: CLUSTER not lose indexes
Date: 2002-07-05 02:54:49
Message-ID: Pine.LNX.4.44.0207042235580.16373-200000@cm-lcon-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hackers:

I've modified commands/cluster.c so that it recreates the indexes on the
table after clustering the table. I attach the patch.

There are (of course) things I don't understand. For example, whether
(or when) I should use CommandCounterIncrement() after each
index_create, or if I should call setRelhasindex() only once (and not
once per index); or whether I need to acquire some lock on the indexes.

I tested it with one table and several indexes. Truth is I don't know
how to test for concurrency, or if it's worth the trouble.

The purpose of this experiment (and, I hope, more to follow) is to
familiarize myself with the guts of PostgreSQL, so I can work on my CS
thesis with it. If you can point me my misconceptions I'd be happy to
try again (and again, and...)

Thank you.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"La Primavera ha venido. Nadie sabe como ha sido" (A. Machado)

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2002-07-05 03:17:25 Should next release by 8.0 (Was: Re: [GENERAL] I am being interviewed by OReilly )
Previous Message Rod Taylor 2002-07-05 02:48:06 Re: BETWEEN Node & DROP COLUMN

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-07-05 03:44:08 Re: CLUSTER not lose indexes
Previous Message Manfred Koizar 2002-07-04 18:13:08 Wrap access to Oid II