pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rihad <grihad@gmail.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: pgsql-general General <pgsql-general@postgresql.org>
Subject: Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?
Date: Wed, 23 Aug 2023 18:06:43 +0400
Message-ID: <3fafd9d5-ba37-8abf-ba46-ca51b6f706c9@gmail.com> (raw)
In-Reply-To: <0ebcc8ea-7f5a-d014-d53f-e078622be35d@aklaver.com>
References: <69eacc0a-7e9b-4a35-278b-110b93d72882@mail.ru>
	<18167fbd-815f-9b43-7016-5e5bbb8fb255@gmail.com>
	<9440ab9c-4ee1-7668-5476-dc28e8086524@aklaver.com>
	<c1d7097c-710a-9513-7831-c765a2b622bf@gmail.com>
	<b0bb3ee4-e26c-941a-b326-68b515a09006@aklaver.com>
	<db75baff-dbc7-ee53-6b06-73455428358d@gmail.com>
	<b020c3de-4399-4d35-8dd7-cb64a3a77627@aklaver.com>
	<918f94be-41b9-e684-7679-b6bd819f693c@gmail.com>
	<9fed2b70-cc36-1239-d5b6-7a81afeafb82@aklaver.com>
	<329abf6c-2165-f410-717f-c20b3dd0a3d7@gmail.com>
	<0ebcc8ea-7f5a-d014-d53f-e078622be35d@aklaver.com>

On 8/21/23 20:50, Adrian Klaver wrote:
> On 8/21/23 09:31, Rihad wrote:
>> On 8/21/23 20:17, Adrian Klaver wrote:
>>> On 8/21/23 09:09, Rihad wrote:
>>>> On 8/21/23 20:00, Adrian Klaver wrote:
>>>
>
>>
>> Sorry, they are all as per default, commented out in the config.
>>
>> There are no long running queries, otherwise they wouldn't be 
>> vacuumed/analyzed in due time after running first manual analyze, 
>> which updates n_live_tup to match reltuples.
>>
>
> My only remaining suggestion is to closely monitor the Postgres log 
> and see if provides a clue.
>
I'm awfully sorry, I read the autovacuum manual carefully, it isn't 
n_live_tup, but reltuples that is taken into account during the calculation.


vacuum threshold = vacuum base threshold + vacuum scale factor * number of tuples

where the vacuum base threshold is autovacuum_vacuum_threshold 
<https://www.postgresql.org/docs/current/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-THRESHO...;, 
the vacuum scale factor is autovacuum_vacuum_scale_factor 
<https://www.postgresql.org/docs/current/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-SCALE-F...;, 
*and the number of tuples is **|pg_class|**.**|reltuples|**.*


Your first suggestion was to RTFM.

view thread (13+ messages)

Message-ID: <3fafd9d5-ba37-8abf-ba46-ca51b6f706c9@gmail.com>
Permalink:  ../3fafd9d5-ba37-8abf-ba46-ca51b6f706c9@gmail.com/
Also on:    postgresql.org/message-id/3fafd9d5-ba37-8abf-ba46-ca51b6f706c9@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: grihad@gmail.com, adrian.klaver@aklaver.com
  Subject: Re: Why doesn't autovacuum/analyze run in due time after calling pg_stat_reset?
  In-Reply-To: <3fafd9d5-ba37-8abf-ba46-ca51b6f706c9@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox