Re: Resumable vacuum proposal and design overview

From: "Matthew T(dot) O'Connor" <matthew(at)tocr(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Galy Lee <lee(dot)galy(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Resumable vacuum proposal and design overview
Date: 2007-02-27 17:15:52
Message-ID: 45E46748.3070903@tocr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> "Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:
>> On Tue, 2007-02-27 at 10:37 -0600, Jim C. Nasby wrote:
>>> ... The idea would be to give vacuum a target run time, and it
>>> would monitor how much time it had remaining, taking into account how
>>> long it should take to scan the indexes based on how long it's been
>>> taking to scan the heap. When the amount of time left becomes less than
>>> the estimate of the amount of time required to scan the indexes (and
>>> clean the heap), you stop the heap scan and start scanning indexes.
>
>> I do like this idea, but it also seems easy to calculate that bit
>> yourself. Run VACUUM, after X minutes issue stop_vacuum() and see how
>> long it takes to finish. Adjust X until you have it right.
>
> One problem with it is that a too-small target would result in vacuum
> proceeding to scan indexes after having accumulated only a few dead
> tuples, resulting in increases (potentially enormous ones) in the total
> work needed to vacuum the table completely.
>
> I think it's sufficient to have two cases: abort now, and restart from
> the last cycle-completion point next time (this would basically just be
> SIGINT); or set a flag to stop at the next cycle-completion point.
>
>
> It occurs to me that we may be thinking about this the wrong way
> entirely. Perhaps a more useful answer to the problem of using a
> defined maintenance window is to allow VACUUM to respond to changes in
> the vacuum cost delay settings on-the-fly. So when your window closes,
> you don't abandon your work so far, you just throttle your I/O rate back
> to whatever's considered acceptable for daytime vacuuming.

I thought we already did that? Which BTW was part of my plan on how to
deal with a vacuum that is still running after it's maintenance window
has expired.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-02-27 17:16:28 Re: 7.x horology regression test on Solaris buildfarm machines
Previous Message Matthew T. O'Connor 2007-02-27 17:12:22 Re: autovacuum next steps, take 2