Re: really lazy vacuums? - Mailing list pgsql-hackers

From Robert Haas
Subject Re: really lazy vacuums?
Date
Msg-id AANLkTinraLZEtP_nb_V4UJUm6ErNP+FATTFu9BiyfZbS@mail.gmail.com
Whole thread Raw
In response to Re: really lazy vacuums?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Mar 14, 2011 at 8:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Mon, Mar 14, 2011 at 4:18 PM, Tom Lane <tgl@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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: really lazy vacuums?
Next
From: sanjay verma
Date:
Subject: PostgreSQL 8.4 support on Windows 2008 R2