Re: compute_query_id and pg_stat_statements

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, Christoph Berg <myon(at)debian(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: compute_query_id and pg_stat_statements
Date: 2021-05-11 07:39:06
Message-ID: CABUevEwrn4hBGou9Z_oQRs--Xv8+BRJbGGfOG6sibraka83WNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 11, 2021 at 8:04 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Tue, Apr 27, 2021 at 02:25:04PM +0800, Julien Rouhaud wrote:
> > On Mon, Apr 26, 2021 at 11:37:45AM -0700, Andres Freund wrote:
> >> On 2021-04-26 14:21:00 -0400, Tom Lane wrote:
> >>> That's sounding like a pretty sane design, actually. Not sure about
> >>> the shared-library-name-with-fixed-function-name detail, but certainly
> >>> it seems to be useful to separate "I need a query-id" from the details
> >>> of the ID calculation.
> >>>
> >>> Rather than a GUC per se for the ID provider, maybe we could have a
> >>> function hook that defaults to pointing at the in-core computation,
> >>> and then a module wanting to override that just gets into the hook.
> >>
> >> I have a preference to determining the provider via GUC instead of a
> >> hook because it is both easier to introspect and easier to configure.
>
> So, this thread has died two weeks ago, and it is still an open item.
> Could it be possible to move to a resolution by beta1? The consensus
> I can get from the thread is that we should have a tri-value state to
> track an extra "auto" for the query ID computation, as proposed by
> Alvaro here:
> https://www.postgresql.org/message-id/20210426174331.GA19401@alvherre.pgsql

Technically I think that was my suggestion from earlier in that thread
that Alvaro just +1ed :)

That said, I sort of put that one aside when both Bruce and Tom
considered it "a pretty weird API" to quote Bruce. I had missed the
fact that Tom changed his mind (maybe when picking up on more of the
details).

And FTR, I still think this is the best way forward.

I think Andres also raised a good point about the ability to actually
know which one is in use.

Even if we keep the current way of *setting* the hook, I think it
might be worthwhile to expose a PGC_INTERNAL guc that shows *which*
implementation is actually in use?

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-05-11 07:42:27 Re: Teaching users how they can get the most out of HOT in Postgres 14
Previous Message Michael Paquier 2021-05-11 07:37:13 Re: Performance degradation of REFRESH MATERIALIZED VIEW