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)