Re: autoanalyze did not run - Mailing list pgsql-admin

From Олег Самойлов
Subject Re: autoanalyze did not run
Date
Msg-id b44fea2a-a89d-43fc-baaf-f235e24383b4@ya.ru
Whole thread Raw
In response to Re: autoanalyze did not run  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-admin
26.01.2026 15:14, hubert depesz lubaczewski пишет:
> On Mon, Jan 26, 2026 at 08:31:24AM +0300, Олег Самойлов wrote:
>> What is exact criteria to launch autoanalyze?
> You might want to read
> https://www.depesz.com/2020/02/18/which-tables-should-be-auto-vacuumed-or-auto-analyzed-update/
>
> Best regards,
>
> depesz

Yep, thanks. I rechecked in source. Indeed, autoanalyze depend only on 
mod_since_analyze and anlthresh = (float4) anl_base_thresh + 
anl_scale_factor * reltuples;

https://github.com/postgres/postgres/blob/master/src/backend/postmaster/autovacuum.c#L2901

relation_needs_vacanalyze(Oid relid,
                           AutoVacOpts *relopts,
                           Form_pg_class classForm,
                           PgStat_StatTabEntry *tabentry,
                           int effective_multixact_freeze_max_age,
  /* output params below */
                           bool *dovacuum,
                           bool *doanalyze,
                           bool *wraparound)

And wrote such variables into
elog(DEBUG3, "%s: vac: %.0f (threshold %.0f), ins: (disabled), anl: %.0f 
(threshold %.0f)"




pgsql-admin by date:

Previous
From: nikhil Kumar
Date:
Subject: EFM -switchover error
Next
From: Laurenz Albe
Date:
Subject: Re: autoanalyze did not run