Re: CLUSTER ALL syntax

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема Re: CLUSTER ALL syntax
Дата
Msg-id 3DD8510E.39CFA98C@tpf.co.jp
обсуждение исходный текст
Ответ на Re: CLUSTER ALL syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Alvaro Herrera wrote:
> 
> On Sun, Nov 17, 2002 at 06:43:38PM -0500, Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Bruce Momjian <pgman@candle.pha.pa.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 Inouehttp://w2422.nsk.ne.jp/~inoue/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: CLUSTER ALL syntax
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] DECLARE CURSOR