Re: When manual analyze is needed - Mailing list pgsql-general

From veem v
Subject Re: When manual analyze is needed
Date
Msg-id CAB+=1TULKjDSBHxqSQVQstxcHshGzQUnHfp45GSESAu2qm0VKg@mail.gmail.com
Whole thread Raw
In response to Re: When manual analyze is needed  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: When manual analyze is needed  (veem v <veema0000@gmail.com>)
Re: When manual analyze is needed  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general
On Mon, 4 Mar 2024 at 09:42, Laurenz Albe <laurenz.albe@cybertec.at> wrote:

The only things that require manual ANALYZE are

1. partitioned tables (autoanalyze will collect statistics on the
   partitions, but not the partitioned table itself)


So the partitioned table stats is nothing but the rolledover stats of all the partitions. As you mentioned, autoanalyze only works for child partitions but not the partition tables, so does it mean we have to schedule some jobs manually(through some scheduletr like pg_cron) to analyze these partitioned tables at certain time intervals to keep those up to date for partitioned tables? And won't that scan all the child partitions again to have the stats aggregated/rolled over from all the child partitions level to the table level?

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: When manual analyze is needed
Next
From: veem v
Date:
Subject: Re: When manual analyze is needed