Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgNxp-0001wH-02 for pgsql-hackers@arkaria.postgresql.org; Tue, 11 May 2021 08:42:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lgNxn-0005pf-8b for pgsql-hackers@arkaria.postgresql.org; Tue, 11 May 2021 08:41:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgNxn-0005pX-0p for pgsql-hackers@lists.postgresql.org; Tue, 11 May 2021 08:41:59 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgNxl-0002tx-I2 for pgsql-hackers@lists.postgresql.org; Tue, 11 May 2021 08:41:58 +0000 Received: from hnk.local (p2388012-ipbf1027funabasi.chiba.ocn.ne.jp [118.6.6.12]) by oss.nttdata.com (Postfix) with ESMTPSA id E148D60523; Tue, 11 May 2021 17:41:53 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.2 at oss.nttdata.com Subject: Re: compute_query_id and pg_stat_statements To: Julien Rouhaud , Michael Paquier Cc: Andres Freund , Tom Lane , Alvaro Herrera , Stephen Frost , Magnus Hagander , Bruce Momjian , Christoph Berg , Peter Eisentraut , PostgreSQL Developers References: <2268611.1619458140@sss.pgh.pa.us> <20210426174331.GA19401@alvherre.pgsql> <20210426181408.3j6kkzpxnadpwptv@alap3.anarazel.de> <2295572.1619461260@sss.pgh.pa.us> <20210426183745.4gd2s5qra6mlxfto@alap3.anarazel.de> <20210427062504.ofz3rgedbrl5bep2@nol> <20210511073539.vw4m46vvbqhiwnz5@nol> From: Fujii Masao Message-ID: <4f0929bf-c690-f2be-a050-a69a47a79651@oss.nttdata.com> Date: Tue, 11 May 2021 17:41:53 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210511073539.vw4m46vvbqhiwnz5@nol> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/05/11 16:35, Julien Rouhaud wrote: > Anyway, PFA a patch that implement a [off | on | auto] compute_query_id, and > provides a new queryIdWanted() function to let third party plugins inform us > that they want a query id if possible. Thanks! > As it was noted somewhere in that thread, that's a hack on top on the GUC > machinery, so compute_query_id will display "on" rather than "auto" (or "auto > and enabled" or whatever) since GUC isn't designed to handle that behavior. Can't we work around this issue by making queryIdWanted() set another flag like query_id_wanted instead of overwriting compute_query_id? If we do this, query id computation is necessary when "compute_query_id == COMPUTE_QUERY_ID_ON || (compute_query_id == COMPUTE_QUERY_ID_AUTO && query_id_wanted)". Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION