Re: compute_query_id and pg_stat_statements

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: rjuju123(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 05:44:47
Message-ID: 20210512.144447.2143676030143117355.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 12 May 2021 14:33:35 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
> Ok, if we want to support alternative providers from the first, we
> need to actually write the loader code for query-id providers. It
> would not be so hard?, but it might not be suitable to this stage so I
> proposed that to get rid of needing such complexity for now.
>
> (Anyway I prefer to load query-id provider as a dynamically loadable
> module rather than hook-function.)
...
> So, for example, how about the following interface?
>
> GUC query_id_provider:
>
> - 'none' : query_id is not calculated, don't allow loading external
> generator module.
>
> - 'default' : use default provider and calculate query-id.
>
> - '<provider-name>' : use the provider and calculate query-id using it.
>
> - 'auto' : query_id is not calculated, but allow to load query-id
> provider if queryIdWanted() is called.
>
> # of course 'auto' and 'default' are inhibited as the provier name.
>
> - core function bool queryIdWanted(char *provider_name, bool use_existing)
>
> Allows extensions to request to load a provider if not yet, then
> start calculating query-id. Returns true if the request is accepted.
>
> provider_name :
>
> - 'default' or '<provider-name>': requests the provider to be loaded
> and start calculating query-id. Refuse the request if 'none' is
> set to query_id_provider.
>
> use_existing: Set true to allow using a provider already loaded.
> Otherwise refuses the request if any other provider than
> prvoder_name is already loaded.
>
> In most cases users set query_id_provider to 'auto' and extensions
> call queryIdWanted with ('default', true).

Hmm. They are in contradiction. Based on this future picture, at this
stage it can be simplified to allowing only 'default' as the provider
name.

If you want to support any other provider at this point,,, we need to
imlement the full-spec?

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2021-05-12 05:49:13 Re: compute_query_id and pg_stat_statements
Previous Message Amit Kapila 2021-05-12 05:40:12 Re: parallel vacuum - few questions on docs, comments and code