Re: Why does cluster need the indexname?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "G(dot) Anthony Reina" <reina(at)nsi(dot)edu>, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why does cluster need the indexname?
Date: 2000-06-16 19:16:58
Message-ID: 8472.961183018@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ed Loehr 2000-06-16 19:25:02 Re: planner question re index vs seqscan
Previous Message Bruce Momjian 2000-06-16 19:06:59 Re: Why does cluster need the indexname?