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 10:09:30
Message-ID: 20210512100930.ex5cwkhng2gupgyn@nol
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 12, 2021 at 06:37:24PM +0900, Kyotaro Horiguchi wrote:
> At Wed, 12 May 2021 14:05:16 +0800, Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote in
> >
> > And if I'm not mistaken, pg_store_plans also wants a different queryid
> > implementation, but has to handle a secondary queryid on top of it
> > (https://github.com/ossc-db/pg_store_plans/blob/master/pg_store_plans.c#L843-L855).
>
> Yeah, the extension intended to be used joining with the
> pg_stat_statements view. And the reason for the second query-id dates
> back to the era when query id was not available in the
> pg_stat_statements view. Now it is mere a fall-back query id when
> pg_stat_statments is not active. Now that the in-core query-id is
> available, I think there's no reason to keep that implement.
>
> > So here again what the extension want is to get rid of pg_stat_statements (and
> > now core) queryid implementation.
>
> So the extension might be a good reason for the discussion^^;

Indeed. So IIUC, what pg_store_plans wants is:

- to use its own query_id implementation
- to be able to be joined to pg_stat_statements

Is that correct?

If yes, it seems that starting with pg14, it can be easily achieved by:

- documenting to disable compute_query_id
- eventually error out at execution time if it's enabled
- don't call queryIdWanted()
- expose its query_id

It will then work just fine, and will be more efficient compared to what is
done today as only one queryid will be calculated.

Did I miss something?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-05-12 10:19:34 Re: wal stats questions
Previous Message Julien Rouhaud 2021-05-12 09:51:49 Re: compute_query_id and pg_stat_statements