Robert James wrote:
I would like to CLUSTER a table on its PRIMARY KEY. Now, I haven't explicitly defined and named an index for this table - but the primary key defines one. How can I tell Postgres to CLUSTER on it?

Get the index name:

\d tablename

Right at the bottom it will have the index names:

Indexes:
    "a_pkey" PRIMARY KEY, btree (a)


then cluster:

# cluster tablename using a_pkey;
CLUSTER


Also: If I define an index on a PK, will Postgres make a second one, or realize its redundnant?

Depends how you define it (I think). What's your create table statement look like?

--
Postgresql & php tutorials
http://www.designmagick.com/


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to