On 2021-Aug-17, Justin Pryzby wrote:
> I suggest the attached (which partially reverts the revert), to allow showing
> correct data for analyze_count and last_analyzed.
Yeah, that makes sense and my keeping of the pg_stat_all_tables entries
seems pretty useless without this change. I have pushed a slightly
modified version of this to 14 and master.
> Arguably these should be reported as null in v14 for partitioned tables, since
> they're not "known to be zero", but rather "currently unpopulated".
>
> n_mod_since_analyze | 0
> n_ins_since_vacuum | 0
I don't disagree, but it's not easy to implement this at present. I
think almost all counters should be nulls for partitioned tables. For
some of them one could make a case that it'd be more convenient to
propagate numbers up from partitions.
--
Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/