Re: CLUSTER all tables at once?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)atentus(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: CLUSTER all tables at once?
Date: 2002-08-12 22:14:41
Message-ID: 19051.1029190481@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)atentus(dot)com> writes:
> Maybe if some index had the indisclustered bit set one could select
> that; but is it possible for some table to have more than one index with
> it? Intuition (but no code observation) says no.

At the moment that bit will never be set at all, unless you were to
reach in and set it with a manual "UPDATE pg_index" command.

It would probably be feasible for the CLUSTER code to update the system
catalogs to set the bit on the index used for the clustering (and clear
it from any others it might be set on). Then indisclustered would have
the semantics of "the index most recently used in CLUSTERing its table",
which seems pretty reasonable. And it'd fit in nicely as the control
bit for an auto-CLUSTER command.

> And what happens with those tables that do not have any such index?

Nothing, would be my vote. You'd just re-CLUSTER all tables that have
been clustered before, the same way they were last clustered.

(I'm not actually convinced that this behavior is worth the code space
it'd take to implement, btw.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Copeland 2002-08-12 22:40:03 Re: python patch
Previous Message Tom Lane 2002-08-12 21:57:03 VACUUM's "No one parent tuple was found", redux