Re: pg_stat_statements and "IN" conditions

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, Sergei Kornilov <sk(at)zsrv(dot)org>, yasuo(dot)honda(at)gmail(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, smithpb2250(at)gmail(dot)com, vignesh21(at)gmail(dot)com, michael(at)paquier(dot)xyz, nathandbossart(at)gmail(dot)com, stark(dot)cfm(at)gmail(dot)com, geidav(dot)pg(at)gmail(dot)com, marcos(at)f10(dot)com(dot)br, robertmhaas(at)gmail(dot)com, david(at)pgmasters(dot)net, pgsql-hackers(at)postgresql(dot)org, pavel(dot)trukhanov(at)gmail(dot)com, Sutou Kouhei <kou(at)clear-code(dot)com>
Subject: Re: pg_stat_statements and "IN" conditions
Date: 2025-02-11 18:52:33
Message-ID: 202502111852.btskmr7nhien@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Feb-11, Sami Imseih wrote:

> I have only looked at 0001, but I am wondering why
> query_id_const_merge is a pg_stat_statements GUC
> rather than a core GUC?

I was wondering the same thing and found the explanation
here:
https://postgr.es/m/ZTmuCtymIS3n3fP_@paquier.xyz

> Other extensions that consume queryIds may also want this
> behavior without needing to enable pg_stat_statements.

I agree. In fact, pg_stat_activity will behave differently (using
merged query_ids) if this value is turned on, for which you need the
contrib module. This makes no sense to me.

Besides, the patch cheats in this regard: what Dmitry did was
create a function SetQueryIdConstMerge() which the extension with the
GUC can call to set the value of the variable. I really don't see that
this is better. I think we should put the GUC back where it was in v15
of the patch. (I didn't check what other changes there were
afterwards.)

About the GUC name -- query_id_const_merge -- I think this is too much a
hacker's name. How about
query_id_merge_values
query_id_merge_value_lists
query_id_squash_constant_lists

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"No es bueno caminar con un hombre muerto"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2025-02-11 18:52:34 Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup
Previous Message Álvaro Herrera 2025-02-11 18:51:43 Re: pg_stat_statements and "IN" conditions