Re: CLUSTER ALL syntax

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CLUSTER ALL syntax
Date: 2002-11-18 02:31:42
Message-ID: 3DD8510E.39CFA98C@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Alvaro Herrera wrote:
>
> On Sun, Nov 17, 2002 at 06:43:38PM -0500, Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>
> > > > And what about REINDEX? That seems to have a different
> > > > syntax from the other two. Seems there should be some > > > > consistency.
> > >
> > > We don't have a REINDEX ALL, and I'm not in a hurry to invent one.
> > > (Especially, I'd not want to see Alvaro spending time on that
> > > instead of fixing the underlying btree-compaction problem ;-))
> >
> > My point for REINDEX was a little different. The man pages shows:
> >
> > REINDEX { DATABASE | TABLE | INDEX } <replaceable
> > class="PARAMETER">name</replaceable> [ FORCE ]
> >
> > where we don't have ALL but we do have DATABASE. Do we need that
> > tri-valued secodn field for reindex because you can reindex a
> > table _or_ and index, and hence DATABASE makes sense? I am just
> > asking.
>
> REINDEX DATABASE is for system indexes only, it's not the same that one
> would think of REINDEX alone (which is all indexes on all tables, isn't
> it?).

Probably You don't understand the initial purpose of REINDEX.
It isn't an SQL standard at all and was intended to recover
corrupted system indexes. It's essentially an unsafe operation
and so the operation was inhibited other than under standalone
postgres. I also made the command a little hard to use to avoid
unexpected invocations e.g. REINDEX DATABASE requires an unnecessary
database name parameter or FORCE is still needed though it's a
requisite parameter now.

REINDEX is also used to compact indexes now. It's good but
the purpose is different from the initial one and we would
have to reorganize the functionalities e.g. the table data
isn't needed to compact the indexes etc.

> What I don't understand is what are the parameters in the
> ReindexDatabase function for. For example, the boolean all
> is always false in tcop/utility.c (and there are no other
> places that the function is called).

I intended to implement the *true* case also then
but haven't done it yet, sorry.

regards,
Hiroshi Inoue
http://w2422.nsk.ne.jp/~inoue/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Wheeler 2002-11-18 03:00:30 DBD::PostgreSQL
Previous Message Matthew V. 2002-11-18 02:27:41 Re: DECLARE CURSOR

Browse pgsql-patches by date

  From Date Subject
Next Message Rod Taylor 2002-11-18 17:00:21 Transaction safe Truncate
Previous Message Christopher Kings-Lynne 2002-11-18 01:53:07 Re: CLUSTER ALL syntax