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 1lZEm2-0006TL-AI for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Apr 2021 15:28:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lZEm0-0003rs-TI for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Apr 2021 15:28:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZEm0-0003rl-MD for pgsql-hackers@lists.postgresql.org; Wed, 21 Apr 2021 15:28:16 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZEly-0001zw-MR for pgsql-hackers@lists.postgresql.org; Wed, 21 Apr 2021 15:28:15 +0000 Received: from hnk.local (p2043043-ipbf1801funabasi.chiba.ocn.ne.jp [221.185.194.43]) by oss.nttdata.com (Postfix) with ESMTPSA id E959762402; Thu, 22 Apr 2021 00:28:11 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view? To: Bruce Momjian , Alvaro Herrera Cc: Julien Rouhaud , Tom Lane , Nitin Jadhav , Hannu Krosing , Robert Haas , Pavel Stehule , Michael Paquier , torikoshia , Atsushi Torikoshi , Tatsuro Yamada , Tomas Vondra , Evgeny Efimkin , PostgreSQL Hackers References: <20210413021246.GD4231@momjian.us> <20210413173016.GA29955@alvherre.pgsql> <20210414183326.GA10946@momjian.us> <20210420162244.GD30205@momjian.us> From: Fujii Masao Message-ID: Date: Thu, 22 Apr 2021 00:28:11 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <20210420162244.GD30205@momjian.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/04/21 1:22, Bruce Momjian wrote: > On Wed, Apr 14, 2021 at 02:33:26PM -0400, Bruce Momjian wrote: >> On Tue, Apr 13, 2021 at 01:30:16PM -0400, Álvaro Herrera wrote: >>> On 2021-Apr-12, Bruce Momjian wrote: >>> >>>> OK, the attached patch renames pg_stat_activity.queryid to 'query_id'. I >>>> have not changed any of the APIs which existed before this feature was >>>> added, and are called "queryid" or "queryId" --- it is kind of a mess. >>>> I assume I should leave those unchanged. It will also need a catversion >>>> bump. >>> >>> I think it is fine actually. These names appear in structs Query and >>> PlannedStmt, and every single member of those already uses camelCase >>> naming. Changing those to use "query_id" would look out of place. >>> You did change the one in PgBackendStatus to st_query_id, which also >>> matches the naming style in that struct, so that looks fine also. >>> >>> So I'm -1 on Julien's first proposed change, and +1 on his second >>> proposed change (the name of the first argument of >>> pgstat_report_query_id should be query_id). >> >> Thanks for your analysis. Updated patch attached with the change >> suggested above. > > Patch applied. I found another small issue in pg_stat_statements docs. The following description in the docs should be updated so that toplevel is included? > This view contains one row for each distinct database ID, user ID and query ID Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION