Re: Should I CLUSTER on PRIMARY KEY
От | Robert James |
---|---|
Тема | Re: Should I CLUSTER on PRIMARY KEY |
Дата | |
Msg-id | e09785e00907191756q74114720x298cb2d684e4054d@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Should I CLUSTER on PRIMARY KEY (Chris <dmagick@gmail.com>) |
Ответы |
Re: Should I CLUSTER on PRIMARY KEY
Re: Should I CLUSTER on PRIMARY KEY |
Список | pgsql-general |
Thanks, Chris. Is there a way to do this deterministically, or at least programatically? I have code to create the tables and cluster them automatically?
On Sun, Jul 19, 2009 at 8:21 PM, Chris <dmagick@gmail.com> wrote:
Robert James wrote:Get the index name: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?
\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;
CLUSTERDepends how you define it (I think). What's your create table statement look like?Also: If I define an index on a PK, will Postgres make a second one, or realize its redundnant?
--
Postgresql & php tutorials
http://www.designmagick.com/
В списке pgsql-general по дате отправления: