Re: Loss of cluster status

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Loss of cluster status
Дата
Msg-id 14883.1045841249@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Loss of cluster status  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Ответы Re: Loss of cluster status  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
>> Would it be an idea to issue a CLUSTER command after the CREATE TABLE
>> statement in SQL dumps for tables that have an indisclustered index?

Yeah...

> Actually, rather than a full-blown CLUSTER, how about...:

> UPDATE pg_index SET indisclustered=true WHERE indrelid=(SELECT oid FROM
> pg_class WHERE relname='mytable' AND relnamespace = (SELECT oid FROM
> pg_namespace WHERE nspname=CURRENT_SCHEMA()));

No; directly manipulating the system catalogs in dump scripts is a
crummy idea, because (a) it only works if you're superuser, and (b)
it creates a nasty backwards-compatibility problem if we change the
catalogs involved.

A CLUSTER command issued just after table creation, while it's still
empty, would be cheap ... but we don't put the index in place until
we've loaded the data, do we?  Darn.
        regards, tom lane


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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: contrib Makefile's and OS X
Следующее
От: Tom Lane
Дата:
Сообщение: Re: possibly spurious `EXCEPT ... may not refer to other relation...'