Re: Integrated autovacuum

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Integrated autovacuum
Date: 2005-07-27 21:21:16
Message-ID: 20050727212116.GF1832@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 27, 2005 at 02:07:28PM -0700, Joshua D. Drake wrote:

> Great Thanks... Could I get a better explanation of the following:
>
> #autovacuum_vacuum_scale_factor = 0.4 # fraction of rel size before vacuum
> #autovacuum_analyze_scale_factor = 0.2 # fraction of rel size before
> analyze

Sure. We use a scoring system:

score = X_base_threshold + X_scale_factor * reltuples

where X is one of vacuum or analyze. reltuples is the number for
pg_class.

We decide to vacuum if the number of dead tuples in the table as
reported to the stats system is higher than the score. If it isn't, we
decide to analyze if the number of new tuples since last analyze + dead
tuples since last analyze is higher than the score.

This all will become clearer when we have real docs for autovacuum.

Also, somebody (Rod Taylor I think) proposed changed the variable names
to

vacuum_auto_vacuum_scale_factor
vacuum_auto_analyze_scale_factor

etc. I haven't seen much agreement nor disagreement with the idea. I
agree with that on principle but you have to admit the above names are
confusing and too long.

--
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"Las cosas son buenas o malas segun las hace nuestra opinión" (Lisias)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2005-07-27 21:23:54 Re: Integrated autovacuum
Previous Message Joshua D. Drake 2005-07-27 21:07:28 Re: Integrated autovacuum