Re: Autovacuum / full vacuum

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Michael Riess <mlriess(at)gmx(dot)de>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Autovacuum / full vacuum
Date: 2006-01-17 13:19:58
Message-ID: 20060117131958.GC2785@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Michael Riess wrote:
> hi,
>
> I'm curious as to why autovacuum is not designed to do full vacuum.

Because a VACUUM FULL is too invasive. Lazy vacuum is so light on the
system w.r.t. locks that it's generally not a problem to start one at
any time. On the contrary, vacuum full could be a disaster on some
situations.

What's more, in general a lazy vacuum is enough to keep the dead space
within manageability, given a good autovacuum configuration and good FSM
configuration, so there's mostly no need for full vacuum. (This is the
theory at least.) For the situations where there is a need, we tell you
to issue it manually.

> So my question is: What's the use of an autovacuum daemon if I still
> have to use a cron job to do full vacuums? wouldn't it just be a minor
> job to enhance autovacuum to be able to perform full vacuums, if one
> really wants it to do that - even if some developers think that it's the
> wrong approach?

Yes, it is a minor job to "enhance" it to perform vacuum full. The
problem is having a good approach to determining _when_ to issue a full
vacuum, and having a way to completely disallow it. If you want to do
the development work, be my guest (but let us know your design first).
If you don't, I guess you would have to wait until it comes high enough
on someone's to-do list, maybe because you convinced him (or her, but we
don't have Postgres-ladies at the moment AFAIK) monetarily or something.

You can, of course, produce a patch and use it internally. This is free
software, remember.

--
Alvaro Herrera Developer, http://www.PostgreSQL.org
"God is real, unless declared as int"

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Andrew Sullivan 2006-01-17 13:28:59 Re: new to postgres (and db management) and performance already a problem :-(
Previous Message Michael Stone 2006-01-17 12:08:05 Re: Autovacuum / full vacuum