Skip site navigation (1) Skip section navigation (2)

Autovacuum integration patch

From: Alvaro Herrera <alvherre(at)surnet(dot)cl>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Autovacuum integration patch
Date: 2005-06-29 23:34:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches

(Resend, like fifth time or so.  bzip2'ing the patch for luck.)

Here is a first cut at autovacuum integration.  Please have a look at
it.  Note that this patch automatically creates three new files:


Note that the daemon is not activated by default.

There are several things that are painfully evident with this thing on:

- TRUNCATE does not update stats.  It should send a stat message to
  which we can react.

- If you empty a whole table using DELETE just after an
  automatically-issued VACUUM takes place, the new threshold may not be
  enough to trigger a new VACUUM.  Thus you end up with a bloated table,
  and it won't get vacuumed until it grows again.  This may be a problem
  with the cost equations, but those are AFAICT identical to those of
  pg_autovacuum, so we may need to rethink the equations.

- The default value of on for reset stats on server start is going to be
  painful with autovacuum, because it reacts badly to losing the info.

- We should make VACUUM and ANALYZE update the pg_autovacuum relation,
  in order to make the autovacuum daemon behave sanely with manually

- Having an autovacuum process running on a database can be surprising
  if you want to drop a database, or create a new one using it as a
  template.  This happenned to me several times.

- The shutdown sequence is not debugged nor very well tested.  It may be
  all wrong.

- The startup sequence is a mixture from pgarch, normal backend and
  pgstat.  I find it relatively clean but I can't swear it's bug-free.

- There are no docs

- There are no ALTER TABLE commands to change the pg_autovacuum
  attributes for a table. (Enable/disable, set thresholds and scaling

- I compiled with -DEXEC_BACKEND, but I didn't look to see if it
  actually worked on that case.

Apart from all these issues, it is completely functional :-)  It can
survive several "make installcheck" runs without problem, and the
regression database is vacuumed/analyzed as it runs.

Some of these issues are trivial to handle.  However I'd like to release
this right now, so I can go back to "shared dependencies" now that role
support is in.

Barring any objections I think this should be integrated, so these
issues can be tackled by interested parties.

Alvaro Herrera (<alvherre[a]>)
"World domination is proceeding according to plan"        (Andrew Morton)

Attachment: autovacuum-4.patch.bz2
Description: application/octet-stream (15.3 KB)


pgsql-patches by date

Next:From: Neil ConwayDate: 2005-06-30 02:00:25
Subject: Re: libpq: fix unlikely memory leak
Previous:From: Satoshi NagayasuDate: 2005-06-29 23:14:30
Subject: Re: Open items

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group