Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?
Date: 2023-08-21 14:47:05
Message-ID: 0e2c7bb6-1d9e-200d-d68a-a5a6e1047cab@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/20/23 14:10, Rihad wrote:
> On 8/20/23 20:22, Adrian Klaver wrote:
>> On 8/18/23 22:35, Rihad wrote:
>>> On 8/17/23 13:01, rihad wrote:
>>>>
>>>> Hi, all. After calling pg_stat_reset all statistics used by autovacuum
>>>> got zeroed, and started accumulating from scratch. Some tables get
>>>> acted upon properly, some don't.
>>>>
>>>>
>>> Self-replying: yup, it seems there's an arbitrary limit of 100K of
>>> n_live_tup after which autovac/analyze kicks in, or it seems so.
>>
>> To know rather then guess read:
>>
>> https://www.postgresql.org/docs/current/routine-vacuuming.html#AUTOVACUUM
>
>
> Sure, I read it before asking.
>
> Taking the first table in the list as an example:
>
>
>         relname          | n_live_tup | n_dead_tup |   left   |
> n_mod_since_analyze |  left
> --------------------------+------------+------------+----------+---------------------+--------
> fooooooooooo             |      32781 |     240663 |  -234057 |
>              513265 | -509937
>
>
> n_dead_tup (not the actual value, but some time after calling
> pg_stat_reset) is much larger than 20% of n_live_tup 32781, and
> n_mod_since_analyze is much larger than 10% of it.
>
> Yet it is kept unvacuumed and unanalyzed for a long time.
>
> autovacuum_(vacuum|analyze)_threshold is 50.
>
> What am I missing?
>

What are your autovacuum_(vacuum|analyze_*scale_factor* values?

--
Born in Arizona, moved to Babylonia.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2023-08-21 15:08:27 Re: Loops and Case Statements Involving Dates
Previous Message Wen Yi 2023-08-21 14:14:51 Re: A Good Beginner's Book