public inbox for [email protected]  
help / color / mirror / Atom feed
From: Олег Самойлов <[email protected]>
To: Laurenz Albe <[email protected]>
To: Pgsql-admin <[email protected]>
Subject: Re: autoanalyze did not run
Date: Tue, 27 Jan 2026 14:39:44 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

<div> </div><div> </div><div>----------------</div><div>Кому: Олег Самойлов ([email protected]), Pgsql-admin ([email protected]);</div><div>Тема: autoanalyze did not run;</div><div>26.01.2026, 19:03, "Laurenz Albe" &lt;[email protected]&gt;:</div><blockquote><p>On Mon, 2026-01-26 at 17:35 +0300, Олег Самойлов wrote:</p><blockquote> &gt; &gt; I try to investigate why autoanalyze did not run in time of our initial<br /> &gt; &gt; loading data. Yes, I know, running analyze manually is highly<br /> &gt; &gt; recommended in such case. But is must run automatically too.<br /> &gt; &gt;<br /> &gt; &gt; PostgreSQL 17.7 (Debian 17.7-3.pgdg13+1) on x86_64-pc-linux-gnu,<br /> &gt; &gt; compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit (from PGDG)<br /> &gt;<br /> &gt; Are you sure that you committed the transaction?<br /> <br /> I am very sure, thats why there are 13844347 rows in that table. By single copy.<br /> &gt;<br /> &gt; Is "track_activities" set to "on"?<br /> <br /> I checked, yep.</blockquote><p><br />Then the only explanation is that all autovacuum workers are active, and this<br />table is starved. See how many autovacuum workers are visible in pg_stat_activity<br />and compare that to autovacuum_max_workers.<br /><br />Yours,<br />Laurenz Albe</p></blockquote><div>Now 0. But they worked. The reason is other. Look, first of all, there was not a statistic reset.</div><div><div><span style="font-family:'courier new' , monospace">SELECT stats_reset is null FROM pg_stat_database WHERE datname = current_database();</span></div><div><span style="font-family:'courier new' , monospace"> ?column?\c </span></div><div><span style="font-family:'courier new' , monospace">----------</span></div><div><span style="font-family:'courier new' , monospace"> t</span></div><div><span style="font-family:'courier new' , monospace">(1 row)</span><div><div><span style="font-family:'courier new' , monospace"> select analyze_count,autoanalyze_count,reltuples, n_live_tup, n_tup_ins, n_tup_upd, n_mod_since_analyze from pg_stat_user_tables as s join pg_class as c on (s.relid=c.oid) where relkind='r' and reltuples&gt;0 limit 10;</span></div><div><span style="font-family:'courier new' , monospace"> analyze_count | autoanalyze_count |   reltuples   | n_live_tup | n_tup_ins | n_tup_upd | n_mod_since_analyze</span></div><div><span style="font-family:'courier new' , monospace">---------------+-------------------+---------------+------------+-----------+-----------+---------------------</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 |             8 |          0 |         0 |         0 |                   0</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 |         76596 |          0 |         0 |         0 |                   0</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 |        140997 |          0 |         0 |         0 |                   0</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 |  2.088436e+07 |          0 |         0 |         0 |                   0</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 | 1.2661012e+07 |          0 |         0 |         0 |                   0</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 |  2.288401e+07 |          0 |         0 |         0 |                   0</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 |         99926 |          0 |         0 |         0 |                   0</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 | 1.5620866e+07 |          0 |         0 |         0 |                   0</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 |         17511 |          0 |         0 |         0 |                   0</span></div><div><span style="font-family:'courier new' , monospace">             0 |                 0 |        400926 |          0 |         0 |         0 |                   0</span></div>The reason is the <span style="background-color:transparent;font-family:'courier new' , monospace">n_mod_since_analyze is 0. Thats why autoanalyze didn't started.</span></div></div></div>

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: autoanalyze did not run
  In-Reply-To: <[email protected]>

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

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