Index recreation in vacuum

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "pgsql-hackers" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Index recreation in vacuum
Date: 2000-01-18 09:18:52
Message-ID: 002101bf6195$09437360$2801007e@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I'm trying to implement REINDEX command.

REINDEX operation itself is available everywhere and
I've thought about applying it to VACUUM.
.
My plan is as follows.

Add a new option to force index recreation in vacuum
and if index recreation is specified.

1) invalidate all indexes of the target table
2) vacuum the target table(heap table only)
3) internal commit and truncation
4) recreate and validate all indexes of the table.

The problem is how to invalidate/validate indexes.
Of cource natural way is to drop/create indexes but the
definition of indexes would be lost in case of abort/crash.
Now I'm inclined to use relhasindex of pg_class to
validate/invalidate indexes of a table at once.

I remember many people have referred to index recreation
in vacuum.

Any comment would be greatly appreciated.

Regards.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2000-01-18 12:58:40 Cannot compile psql
Previous Message Tom Lane 2000-01-18 07:31:26 Re: [HACKERS] Is pg_dump still broken?