Re: autovacuum_analyze_scale_factor and autovacuum_analyze_scale_factor

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Henry Francisco Garcia Cortez <garcortez(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: autovacuum_analyze_scale_factor and autovacuum_analyze_scale_factor
Date: 2021-01-07 01:53:31
Message-ID: 38c4371df337331ce4c8d97c3ea1ecce30fc4988.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, 2021-01-06 at 11:05 -0600, Henry Francisco Garcia Cortez wrote:
> I have a question why settings default postgresql has autovacuum_vacuum_scale_factor in 0.2
> is higher than autovacuum_analyze_scale_factor 0.1, so If want to tune these parameters,
> I always must leave autovacuum_vacuum_scale_factor higher than autovacuum_analyze_scale_factor,
> for instance I wanted to leave autovacuum_vacuum_scale_factor in 0.002 and
> autovacuum_analyze_scale_factor in 0.001

The autovacuum scale factor has been twice the autoanalyze scale factor since the
beginning. You could search the archives from around 2004 for a reason, but I'd
say it might have to do with the fact that ANALYZE is much cheaper than VACUUM,
and that the impact of bad statistics is usually more severe than the impact of
some dead tuples.

But there is no need for you to keep it that way when you change the parameters.
For example, if you want to speed up index only scans, you may want to set
"autovacuum_vacuum_scale_factor" to something like 0.01, but leave
"autovacuum_analyze_scale_factor" at the default value.

The values that you suggest seem much too low - that will result in autovacuum
running all the time.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2021-01-07 01:56:11 Re: quick q re migration, index, stats
Previous Message Henry Francisco Garcia Cortez 2021-01-06 17:05:41 autovacuum_analyze_scale_factor and autovacuum_analyze_scale_factor