Re: [PATCHES] smartvacuum() instead of autovacuum

From: Matthew O'Connor <matthew(at)zeut(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Hitoshi Harada <hitoshi_harada(at)forcia(dot)com>, 'Peter Eisentraut' <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] smartvacuum() instead of autovacuum
Date: 2006-10-23 22:39:23
Message-ID: 453D449B.50404@zeut.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> "Jim C. Nasby" <jim(at)nasby(dot)net> writes:
>> The only case I can think of where autovac might not work as well as
>> smartvacuum would be if you had a lot of databases in the cluster, since
>> autovacuum will only vacuum one database at a time.
>
> It's conceivable that it'd make sense to allow multiple autovac
> processes running in parallel. (The infrastructure part of this is easy
> enough, the hard part is keeping them from all deciding to vacuum the
> same table.)
>
> One reason we have not done that already is the thought that multiple
> vacuum processes would suck too much I/O to be reasonable. Now you
> could dial back their resource demands with the cost-delay settings,
> but it's not clear that ten autovacs running at one-tenth speed are
> better than one autovac using all the cycles you can spare. Usually
> I think it's best if a vacuum transaction finishes as fast as it can.

I think this is one of the reasons table specific delay settings were
designed in from the beginning. I think the main use cases for multiple
vacuums at once are:
1) Vacuum per table space assuming each table space is on a different
drive with it's own I/O.
2) the frequently updated table that can't wait to be vacuumed while a
large table is being vacuumed. In this case if you set a system default
delay setting and set a more aggressive table specific delay setting for
your hot spot tables then multiple vacuums become a clear win. This is
an important case that I hope we handle soon. At this point it's one of
the main failings of the current autovacuum system.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2006-10-23 23:06:26 Re: New CRC algorithm: Slicing by 8
Previous Message Kenneth Marshall 2006-10-23 21:52:18 Re: New CRC algorithm: Slicing by 8

Browse pgsql-patches by date

  From Date Subject
Next Message Jim C. Nasby 2006-10-23 23:08:55 Re: [PATCHES] smartvacuum() instead of autovacuum
Previous Message Thomas H. 2006-10-23 22:26:50 Re: BUG #2712: could not fsync segment: Permission