Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

From: Andres Freund <andres(at)anarazel(dot)de>
To: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry
Date: 2023-02-10 20:15:22
Message-ID: 20230210201522.5cn74vserozyj6pu@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

: Andres Freund <andres(at)anarazel(dot)de>
References: <b9e1f543-ee93-8168-d530-d961708ad9d3(at)gmail(dot)com>
<20230210(dot)113242(dot)699878230551547182(dot)horikyota(dot)ntt(at)gmail(dot)com>
<5420b28c-d33f-d25d-9f47-b06b8a2372ba(at)gmail(dot)com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5420b28c-d33f-d25d-9f47-b06b8a2372ba(at)gmail(dot)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

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-02-10 20:18:39 Re: possible memory leak in VACUUM ANALYZE
Previous Message Pavel Stehule 2023-02-10 20:09:06 possible memory leak in VACUUM ANALYZE