Re: Call closed: Almost happy ending (from "Data files became huge with no apparent reason" thread) - Mailing list pgsql-general

From Tom Lane
Subject Re: Call closed: Almost happy ending (from "Data files became huge with no apparent reason" thread)
Date
Msg-id 24338.1031112310@sss.pgh.pa.us
Whole thread Raw
In response to Re: Call closed: Almost happy ending (from "Data files became huge with no apparent reason" thread)  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.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

pgsql-general by date:

Previous
From: Darren Ferguson
Date:
Subject: Re: parameterized views?
Next
From: "Colin Fox"
Date:
Subject: referential integrity with inheritance