CLUSTER not lose indexes - Mailing list pgsql-patches

From Alvaro Herrera
Subject CLUSTER not lose indexes
Date
Msg-id Pine.LNX.4.44.0207042235580.16373-200000@cm-lcon-46-187.cm.vtr.net
Whole thread Raw
Responses Re: CLUSTER not lose indexes
Re: CLUSTER not lose indexes
List 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

pgsql-patches by date:

Previous
From: Manfred Koizar
Date:
Subject: Wrap access to Oid II
Next
From: Tom Lane
Date:
Subject: Re: CLUSTER not lose indexes