Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> I actually had a thought last night. REINDEX recreates the index, probably
> with *all* rows in the table, whether or not they are still active. Thus, to
> get maximum effect from REINDEX, you need to VACUUM first.
No. REINDEX boils down to IndexBuildHeapScan(), which uses
HeapTupleSatisfiesVacuum() to decide which tuples are worth indexing;
the tuples that get indexed are *exactly* the same ones that would
survive VACUUM.
In recent releases, anyway; before 7.2 things might have been flakier.
regards, tom lane