PostgreSQL 8.x defaults

Palle Girgensohn girgen at
Mon Apr 9 10:04:45 UTC 2007

5 apr 2007 kl. 15.24 skrev Craig Boston:

> I recently installed some PostgreSQL 8.2 servers (and upgraded some  
> from
> 8.1), and it reminded me of a few lingering nits in our port that bug
> me.  Mostly the port seems that it can't make up its mind about VACCUM
> strategy.
> * We have a patch that sets autovacuum = yes in the default
>   postgresql.conf.  However, it leaves the default stats_row_level  
> = no,
>   so autovacuum doesn't actually run.


I've checked it out. Seems I have indeed missed the  
stats_row_level... I'll fix this!

> * Despite trying to turn on autovacuum, the port installs
>   periodic/daily/502.pgsql, which runs VACUUM (not even VACUUM  
>   by default nightly.

It does run vaccumdb -aqz per default, where -z is for analyze:

$ grep daily_pgsql_vacuum_args files/502.pgsql
         su -l pgsql -c "vacuumdb -a -q ${daily_pgsql_vacuum_args}"

> It seems to me that we should pick one or the other -- either
> 1. Fully enable autovacuum and default to  
> daily_pgsql_vacuum_enable="NO"
>    to avoid a superfluous cron job
> or
> 2. Leave the periodic job enabled and not tease people with an
>    ineffectual autovacuum = yes in postgresql.conf.
> Of the two I'd prefer the former, but that's just my opinion.

About the two "strategies" you present; autovacuum will probably need  
some tweaking for most applications, since it will not perform  
vacuums unless a certain percentage of the tuples are changed. Hence,  
usually I use a combination of autovacuum and a nightly vacuumdb -za.  
For smaller installations, the vanilla setup could of course be  
either of your suggestions, or my just suggested combo, it is  
probably a matter of taste. I'd prefer you #1 or the combo... I'll  
think about it a bit more, and will fix the port. :)

Happy easter,

More information about the freebsd-ports mailing list