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: Mon, 21 Aug 2023 20:31:08 +0400
Message-ID: <329abf6c-2165-f410-717f-c20b3dd0a3d7@gmail.com> (raw)
In-Reply-To: <9fed2b70-cc36-1239-d5b6-7a81afeafb82@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>
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:
>
>
>> Thanks for the detailed reply, no tables have custom settings.
>>
>> I need to make it clear once again that all autovac/analyze work as
>> expected when n_live_tup matches reality, i.e. when analyze has been
>> run on them since last reset.
>>
>> A way to fix this is to simply analyze the whole database. Before
>> doing that, while n_live_tup starts from basically 0 and grows based
>> on DB activity, these usual calculations of 10-20% table size for
>> vacuum/analyze don't work. They don't trigger autovac for most
>> tables, or do it much much later.
>>
>
> You still have not said or shown whether the other autovacuum settings
> are the default values or not. Assuming they are, then the only other
> explanation I can come up with is that there is a process or processes
> that are creating long running open transactions that prevent
> autovacuum from running on the affected tables.
>
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.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
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: <329abf6c-2165-f410-717f-c20b3dd0a3d7@gmail.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>
* 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