On Sat, Sep 18, 2021 at 05:15:39PM -0400, Tom Lane wrote: > Justin Pryzby <pry...@telsasoft.com> writes: > > I think the release notes for the autovacuum item (which was first reverted > > and > > then partially un-reverted) should say something like "Partitioned tables > > are > > now included in pg_stat_all_tables": > > | e1efc5b465 Keep stats up to date for partitioned tables > > Hmm. If I'm reading the commit message properly, the actual change there > is not that, but that analyze count and last analyze time are now tracked > correctly for partitioned tables. Might be worth mentioning, not sure.
The reverted patch to autoanalyze included partitioned tables in pg_stat_all_tables, and the revert specifically avoided changing that (to avoid a catbump). But last_analyzed and analyze_count were always shown as "0". So the e1 commit addresses that by tracking that information and showing correct value instead of always 0. The relevant portion starts here: https://www.postgresql.org/message-id/flat/202108161700.d4eh6a7n2lki%40alvherre.pgsql#b2e426eb19dbbddee0adf9bb1bcbbcf1 I suggest that this *should* be included in the release notes, since I specifically requested that partitioned tables be included in 2018. > In 20200418050815(dot)GE26953(at)telsasoft(dot)com I wrote: > |This patch includes partitioned tables in pg_stat_*_tables, which is great; I > |complained awhile ago that they were missing [0]. It might be useful if that > |part was split out into a separate 0001 patch (?). > | [0] > https://www.postgresql.org/message-id/20180601221428.GU5164%40telsasoft.com Also, I've patched my analyze script to use that field (same as for nonpartitioned tables) rather than needing to do a subquery involving max(last_analyzed) of the partitions. Since it's still needed to manually analyze parent tables. -- Justin