Second attempt, roll your own autovacuum

From: Glen Parker <glenebob(at)nwlink(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Second attempt, roll your own autovacuum
Date: 2006-12-18 21:31:03
Message-ID: 45870897.8030202@nwlink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi all,

I am still trying to roll my own auto vacuum thingy. The goal is to
vacuum on demand in one step just like the old days, but not hit the
tables that never change (we have a lot). The idea now is to use a
combination of SQL and shell scripts to duplicate some of what auto
vacuum does. It actually doesn't seem that difficult. I have some SQL
that produces a list of tables that need vacuuming based on statistics
found in pg_stat_user_tables, and reltuples from pg_class, using the
same basic rules as auto vacuum per the documentation. So far so good.
The SQL actually produces an SQL script containing VACUUM commands,
which I can then feed back into psql. The result is a HUGE savings in
vacuum time at night.

The trouble now is, I don't see how to reset the statistics. My
assumption was that vacuum did it, but that appears to be false. How
does autovacuum do it? Can I do it with SQL?

-Glen

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2006-12-18 21:42:29 Re: feature request for Postgresql Rule system.
Previous Message Jeff Davis 2006-12-18 21:30:39 Re: feature request for Postgresql Rule system.

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2006-12-18 21:31:12 Re: pg_restore fails with a custom backup file
Previous Message Magnus Hagander 2006-12-18 21:26:56 Re: effective_cache_size vs units