Обсуждение: REINDEX by table or by index?

Поиск
Список
Период
Сортировка

REINDEX by table or by index?

От
Jeff Boes
Дата:
[Apologies if you have seen this before. I just discovered that posting
to the group via NNTP, at Teranews.com, apparently isn't working since
my posts aren't showing up in the mailing list archives.]

Given a fairly large (7 MRows or so) table with more than one index
(say, two): would it be theoretically faster to do

  REINDEX TABLE "foo";

or

  REINDEX INDEX "ix_foo_one";

and

  REINDEX INDEX "ix_foo_two";

in another session?  (The system in question has two CPUs, if that makes
any difference.)

--
Jeff Boes                                      vox 269.226.9550 ext 24
Database Engineer                                     fax 269.349.9076
Nexcerpt, Inc.                                 http://www.nexcerpt.com
           ...Nexcerpt... Extend your Expertise


Re: REINDEX by table or by index?

От
Tom Lane
Дата:
Jeff Boes <jboes@nexcerpt.com> writes:
> Given a fairly large (7 MRows or so) table with more than one index
> (say, two): would it be theoretically faster to do
>   REINDEX TABLE "foo";
> or
>   REINDEX INDEX "ix_foo_one";
>   REINDEX INDEX "ix_foo_two";

I doubt you could possibly detect any difference.  The indexes are
rebuilt one at a time in any case, and the statement-level overhead
is insignificant.

            regards, tom lane