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

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, 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-03-25 03:00:44
Message-ID: 20230325030044.nhfas3nommsmwl6q@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2023-03-25 11:56:22 +0900, Michael Paquier wrote:
> On Thu, Mar 16, 2023 at 02:13:45PM +0100, Drouvot, Bertrand wrote:
> > On 3/16/23 12:46 PM, Michael Paquier wrote:
> >>> I don't think we should pay any particular attention to those 2 ones
> >>> as anyway nothing prevent the 7 others to be called outside of the
> >>> pg_stat_xact_all_tables view.
> >>
> >> I am not quite sure, TBH. Did you look at the difference with a long
> >> chain of subtrans, like savepoints? The ODBC driver "loves" producing
> >> a lot of savepoints, for example.
> >
> > No, I did not measure the impact.
>
> I have been thinking again about this particular point, and I would be
> fine with an additional boolean flag to compute the subtrans data in
> the global counter when only necessary. This would not make the
> macros for the stat functions that much more complicated, while being
> sure that we don't do unnecessary computations when we know that we
> don't need them..

I don't understand what we're optimizing for here. These functions are very
very very far from being a hot path. The xact functions are barely ever
used. Compared to the cost of query evaluation the cost of iterating throught
he subxacts is neglegible.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-03-25 03:12:50 Re: Add pg_walinspect function with block info columns
Previous Message Michael Paquier 2023-03-25 02:59:10 Re: [PoC] Let libpq reject unexpected authentication requests