Re: Loss of cluster status

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Loss of cluster status
Date: 2003-02-21 15:27:29
Message-ID: 14883.1045841249@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message scott.marlowe 2003-02-21 18:00:53 Re: request for sql3 compliance for the update command
Previous Message Tom Lane 2003-02-21 15:13:18 Re: possibly spurious `EXCEPT ... may not refer to other relation...'