Re: CLUSTER not lose indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CLUSTER not lose indexes
Дата
Msg-id 22491.1025968280@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CLUSTER not lose indexes  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: CLUSTER not lose indexes  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: CLUSTER not lose indexes  (Alvaro Herrera <alvherre@atentus.com>)
Список pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Seems like renamerel will have to stay because it is used by ALTER TABLE
> RENAME, so we just need some new code that updates the relfilenode of
> the old pg_class row to point to the new clustered file.  Swapping
> relfilenodes between the old and new pg_class rows and deleting the new
> table should do the trick of deleting the non-clustered file and the
> temp pg_class row at the same time.

I think you're still letting your thinking be contorted by the existing
CLUSTER implementation.  Do we need a temp pg_class entry at all?  Seems
like we just want to UPDATE the pg_class row with the new relfilenode
value; then we can see the update but no one else can (till we commit).
Ditto for the indexes.

What's still a little unclear to me is how to access the old heap and
index files to read the data while simultaneously accessing the new ones
to write it.  Much of the existing code likes to have a Relation struct
available, not only a RelFileNode, so it may be necessary to have both
old and new Relations present at the same time.  If that's the case we
might be stuck with making a temp pg_class entry just to support a phony
Relation :-(

            regards, tom lane



В списке pgsql-patches по дате отправления:

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: Prepare xlog for optional oid
Следующее
От: "Hiroshi Inoue"
Дата:
Сообщение: Re: [ODBC] UI patch (Was: ODBC Patch to prevent setting of KSQO on 7.3+ servers)