On Mon, Mar 14, 2011 at 8:00 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: > Robert Haas <robertmh...@gmail.com> writes: >> On Mon, Mar 14, 2011 at 4:18 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: >>> Um, if there are *no* dead tuples then we don't look at the indexes >>> anyway ... > >> But you do still have to scan the heap twice. > > Seems like that should be fixable ... is the second pass actually > going to do anything?
Err, I'm wrong. There's no second pass if there are exactly zero tuples to prune. So the possible problem case is when there are some dead tuples, but not all that many compared to the size of the indexes. In theory, you could be better off just reclaiming free space, and waiting for dead tuples to accumulate before cleaning the indexes. I'm not certain whether that target is wide enough to be worth aiming at, but it seems plausible that at least in some workloads the opportunistic index cleaning stuff would keep index bloat under control, so the only reason to ever make a full scan of the indexes during vacuuming would be to avoid leaking CTIDs. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers