I'm probably just missing the point, but why do I have to specify the
indexname for cluster if the table already has a primary key? Wouldn't
cluster want to use the primary key for the table (if it exists) anyway?

Thanks.
-Tony
'


Fri, 16 Jun 2000 11:17:04 -0700
"G. Anthony Reina" <reina@nsi.edu>
Why does cluster need the indexname?
I guess we could default it if they don't specifiy an index.


> I'm probably just missing the point, but why do I have to specify the
> indexname for cluster if the table already has a primary key? Wouldn't
> cluster want to use the primary key for the table (if it exists) anyway?
> 
> Thanks.
> -Tony
> '
> 
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 16 Jun 2000 15:06:59 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Why does cluster need the indexname?
>> I'm probably just missing the point, but why do I have to specify the
>> indexname for cluster if the table already has a primary key? Wouldn't
>> cluster want to use the primary key for the table (if it exists) anyway?

No, you wouldn't necessarily want to cluster on the primary key.
You might be using the primary key to enforce logical consistency,
but be doing most of your actual scans on some secondary index.

I always thought that CLUSTER was being redundant in the other
direction: if you've told it the index name, there's no need to
tell it the base table name.  It can find that out from the index.

			regards, tom lane

Fri, 16 Jun 2000 15:16:58 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Why does cluster need the indexname? 
Tom Lane wrote:

> I always thought that CLUSTER was being redundant in the other
> direction: if you've told it the index name, there's no need to
> tell it the base table name.  It can find that out from the index.
>

Good point. That would make the most sense:

CLUSTER index_name

if index_name was a primary key to a table, then there's no need to specify
the table.

-Tony



Fri, 16 Jun 2000 13:36:03 -0700
"G. Anthony Reina" <reina@nsi.edu>
Re: Why does cluster need the indexname?