HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

PostgreSQL 8.3 - issues with autovacuum

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlissuesautovacuumwith

Problem

I posted this on StackOverflow and it was suggested this query was better suited here.

I'm trying to encourage the use and monitoring of autovacuum in some PostgreSQL 8.3 databases.

One objection I hit often is that people don't "trust" autovacuum or there are bugs in autovacuum in 8.3 which mean that it's ignored in preference to scheduling vacuuming. Mostly our tables are small and this approach appears to work. However, with our larger (& also heavily updated tables) this really doesn't work (dead tuple counts increase, exceed max_fsm_pages, and the tables don't get cleaned up etc etc).

I'm just wondering if anyone has a reference for autovacuum in 8.3 being buggy or not working. My own experience has shown that autovac works fine and, where necessary, adding entries to the pg_autovacuum table does the trick.

I'd like to understand the problem with autovacuum (if one exists).

Solution

-
I can't find any evidence that 8.3 autovacuum is buggy. Autovacuum has been improved in 8.4 with free space maps which obsoletes some parameters which:


(when set incorrectly) could make vacuum less effective

so with 8.3 it is important to set them correctly.

-
The postgres wiki says (and I'm inclined to agree):


As of 8.3, autovacuum is turned on by default, and you should keep it that way.

and:


The answer to almost all vacuuming problems is to vacuum more often,
not less, so that each individual vacuum operation has less to clean up.

-
As you say, "adding entries to pg_autovacuum does the trick" when autovacuum needs to be tweaked - but just be aware that "pg_autovacuum [is] not saved in database dumps"

Context

StackExchange Database Administrators Q#6158, answer score: 7

Revisions (0)

No revisions yet.