On Mon, Nov 30, 2026 at 04:59:21PM -0600, Sami Imseih wrote:
> oops. I attached the wrong one. Thanks for letting me know!
> v22 is correct.

- * Some of the stats are copied to the corresponding pending database stats
- * entry when successfully flushing.

Under pgstat_relation_flush_cb(), I think that this is still valid.
Why is that removed?

-    * Ignore entries that didn't accumulate any actual counts.  If the table
-    * was truncated, we still need to flush the entry to reset the live/dead
-    * counters and ins_since_vacuum even when no other counts were
-    * accumulated.
+    * Skip entries with nothing new since the last flush, unless a truncate
+    * must reset the live/dead counters. 

ins_since_vacuum is still covered by the reset.

A bit further down, the original "Using tuples_inserted to update
ins_since_vacuum does mean.." comment is losing a bit of information,
it seems..

There are a few more of these within pgstat_index_flush_cb(), which
come partially from pgstat_relation.c.

I was reading your patch, and it sounds to me that the main patch
could be split into some independent pieces.  The following things are
standing out, at least:
- The DROP queries in stats.sql.
- Addition of tuples_hot_updated and tuples_newpage_updated to
PgStat_TableXactStatus, which is something that you require for the
in-transaction flushes.
- Introduction of xact_boundary, which reflects most of the mechanical
changes in the patch across all the stats kinds.  At least that should
remove some churn from the main patch.

I'm wondering whether the CFI in the flush loop should be a patch of
its own, as well..  Or perhaps not.
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to