Re: compute_query_id and pg_stat_statements

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: magnus(at)hagander(dot)net, masao(dot)fujii(at)oss(dot)nttdata(dot)com, michael(at)paquier(dot)xyz, andres(at)anarazel(dot)de, tgl(at)sss(dot)pgh(dot)pa(dot)us, alvherre(at)alvh(dot)no-ip(dot)org, sfrost(at)snowman(dot)net, bruce(at)momjian(dot)us, myon(at)debian(dot)org, peter(dot)eisentraut(at)enterprisedb(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: compute_query_id and pg_stat_statements
Date: 2021-05-12 02:42:01
Message-ID: 20210512024201.ak3ofofakn2ymhiv@nol
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Horiguchi-san,

On Wed, May 12, 2021 at 11:08:36AM +0900, Kyotaro Horiguchi wrote:
>
> If we look it in pg_settings, it shows the current value and the value
> at boot-time. So I'm fine with that behavior.
>
> However, IMHO, I doubt the necessity of "on". Assuming that we require
> any module that wants query-id to call queryIdWanted() at any time
> after each process startup (or it could be inherited to children), I
> think only "auto" and "off" are enough for the variable.

I don't think that this approach would cope well for people who want a queryid
without pg_stat_statements or such. Since the queryid can now be found in
pg_stat_activity, EXPLAIN output or the logs I think it's entirely reasonable
to allow users to benefit from that even if they don't install additional
module.

> Thinking in
> this line, the variable is a subset of a GUC variable to specify the
> name of a query-id provider (as Andres suggested upthread), and I
> think it would work better in future.
>
> So for now I propose that we have a variable query_id_provider that
> has only 'default' and 'none' as the domain.

I think this would be a mistake to do that, as it would mean that we don't
officially support alternative queryid provider.

> We can later expand it
> so that any other query-id provider modules can be loaded without
> chaning the interface.

The GUC itself may not change, but third-party queryid provider would probably
need changes as the new entry point will be dedicated to compute a queryid
only, while third-party plugins may do more than that in their
post_parse_analyze_hook. And also users will have to change their
configuration to use that new interface, and additionally the module may now
have to be removed from shared_preload_libraries. Overall, it doesn't seem to
me that it would make users' life easier.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2021-05-12 02:45:04 Re: PG 14 release notes, first draft
Previous Message Andres Freund 2021-05-12 02:32:18 Re: Some other CLOBBER_CACHE_ALWAYS culprits