Re: Feedback on getting rid of VACUUM FULL - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Feedback on getting rid of VACUUM FULL
Date
Msg-id 1253126967.778.36.camel@hvost1700
Whole thread Raw
In response to Re: Feedback on getting rid of VACUUM FULL  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Feedback on getting rid of VACUUM FULL
List pgsql-hackers
On Wed, 2009-09-16 at 13:20 -0500, Kevin Grittner wrote:
> Josh Berkus <josh@agliodbs.com> wrote:
>  
> > a) To date, I have yet to hear a single person bring up an actual
> > real-life use-case where VACUUM FULL was desireable and REWRITE
> > would not be.
>  
> Would rewrite have handled this?:
>  
> http://archives.postgresql.org/pgsql-hackers/2009-09/msg01016.php

If REWRITE is just a CLUSTER using seqscan, then no

If it is a sequence of

1. ordinary VACUUM (it can't run out of FSM anymore, no?)
2. a process moving live tuples from end (using reverse seqscan) to free
space found scanning in first-to-last direction, either one tuple at a
time or one page at a time, until the two scans meet
3. another ordinary VACUUM to actually reclaim the free space

4. repeat a few times so that tuples at the end of relation (for
whatever reason) added while doing 1-3 are also moved towards beginning

then yes, it would have taken some time, but it would have definitely
helped

It would still have caused index bloat, so to get full benefit of it,
one should have finished it up with an equivalent of CONCURRENT REINDEX.

-- 
Hannu Krosing   http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability   Services, Consulting and Training




pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Feedback on getting rid of VACUUM FULL
Next
From: Hannu Krosing
Date:
Subject: Re: Feedback on getting rid of VACUUM FULL