From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Christoph Berg <myon@debian.org>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: compute_query_id and pg_stat_statements
Date: Fri, 14 May 2021 12:20:00 +0900
Message-ID: <63caca55-a48b-a8b4-9c17-814a7106e035@oss.nttdata.com> (raw)
In-Reply-To: <20210514000437.GA14223@alvherre.pgsql>
References: <20210514000437.GA14223@alvherre.pgsql>
On 2021/05/14 9:04, Alvaro Herrera wrote:
> Here's a first attempt at what was suggested. If you say "auto" it
> remains auto in SHOW, but it gets enabled if a module asks for it.
>
> Not final yet, but I thought I'd throw it out for early commentary ...
Many thanks! The patch basically looks good to me.
+void
+EnableQueryId(void)
+{
+ if (compute_query_id == COMPUTE_QUERY_ID_AUTO)
+ auto_query_id_enabled = true;
Shouldn't EnableQueryId() enable auto_query_id_enabled whatever compute_query_id is?
Otherwise, for example, the following scenario can happen and it's a bit strange.
1. The server starts up with shared_preload_libraries=pg_stat_statements and compute_query_id=on
2. compute_query_id is set to auto and the configuration file is reloaded
Then, even though compute_query_id is auto and pg_stat_statements is loaded,
query ids are not computed and no queries are tracked by pg_stat_statements.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: masao.fujii@oss.nttdata.com, alvherre@alvh.no-ip.org, rjuju123@gmail.com, pavel.stehule@gmail.com, horikyota.ntt@gmail.com, magnus@hagander.net, michael@paquier.xyz, andres@anarazel.de, tgl@sss.pgh.pa.us, sfrost@snowman.net, bruce@momjian.us, myon@debian.org, peter.eisentraut@enterprisedb.com, pgsql-hackers@lists.postgresql.org
Subject: Re: compute_query_id and pg_stat_statements
In-Reply-To: <63caca55-a48b-a8b4-9c17-814a7106e035@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox