Do I need to reindex after vacuum full on Postgres 9.4

A REINDEX immediately after a VACUUM FULL is useless because VACUUM FULL itself rebuilds the indexes.

This is mentioned in the 9.4 documentation in Recovering Disk Space :

…to reclaim the excess disk space it occupies, you will need to use
VACUUM FULL, or alternatively CLUSTER or one of the table-rewriting
variants of ALTER TABLE. These commands rewrite an entire new copy of
the table and build new indexes for it.

You are correct that this was not the case before version 9.0, which had VACUUM FULL reimplemented differently.

Up to version 8.4, the reference doc for VACUUM mentioned the need to reindex:

The FULL option does not shrink indexes; a periodic REINDEX is still
recommended. In fact, it is often faster to drop all indexes, VACUUM
FULL, and recreate the indexes.

But this caveat is now obsolete.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)