Index recreation in vacuum - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Index recreation in vacuum
Date
Msg-id 002101bf6195$09437360$2801007e@tpf.co.jp
Whole thread Raw
Responses Re: [HACKERS] Index recreation in vacuum
List 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
truncation4) 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@tpf.co.jp


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Is pg_dump still broken?
Next
From: Michael Meskes
Date:
Subject: FETCH syntax