Hello.
Thank you for the new version.
* Ignore entries that didn't accumulate any actual counts, such as
- * indexes that were opened by the planner but not used.
+ * indexes that were opened by the planner but not used. With
+ * in-transaction flushing an entry may be flushed multiple times, so
keep
+ * it pending if it has active transaction state and commit will merge
+ * counters into it.
*/
if (pg_memory_is_all_zeros(&lstats->counts,
sizeof(struct
PgStat_TableCounts)))
- return true;
+ return (lstats->trans == NULL);
One of my previous comments was that this change makes the callback
return value carry two different meanings. Since whether lstats->trans
is NULL is purely part of the calling context and not derived from the
callback's own work, I still think it is cleaner to keep
pgstat_relation_flush_cb() unchanged and let the caller handle that
distinction instead.
Regards,
--
Kyotaro Horiguchi
NTT Open Source Software Center