: Andres Freund <and...@anarazel.de> References: <b9e1f543-ee93-8168-d530-d961708ad...@gmail.com> <20230210.113242.699878230551547182.horikyota....@gmail.com> <5420b28c-d33f-d25d-9f47-b06b8a237...@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5420b28c-d33f-d25d-9f47-b06b8a237...@gmail.com>
Hi, On 2023-02-10 16:50:32 +0100, Drouvot, Bertrand wrote: > On 2/10/23 3:32 AM, Kyotaro Horiguchi wrote: > > The summarization is needed only by > > few callers but now that cost is imposed to the all callers along with > > additional palloc()/pfree() calls. That doesn't seem reasonable. > > > > I agree that's not the best approach..... I think it's completely fine to do unnecessary reconciliation for the _xact_ functions. They're not that commonly used, and very rarely is there a huge number of relations with lots of pending data across lots of subtransactions. > Let me come back with another proposal (thinking to increment reconciled > counters in pgstat_count_heap_insert(), pgstat_count_heap_delete() and > pgstat_count_heap_update()). Those are the performance crucial functions, we shouldn't do any additional work there if we can avoid it. Shifting cost from the "looking at transactional stats" side to the collecting stats side is the opposite of what we should. Greetings, Andres Freund