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 1oXvv3-0002nq-6e for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2022 02:45: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 1oXvu3-0001zv-Im for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2022 02:43:59 +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 1oXvu3-0001zm-9I for pgsql-hackers@lists.postgresql.org; Tue, 13 Sep 2022 02:43:59 +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 1oXvu0-00077A-KD for pgsql-hackers@lists.postgresql.org; Tue, 13 Sep 2022 02:43:58 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id E767560860; Tue, 13 Sep 2022 11:43:52 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.7 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 13 Sep 2022 11:43:52 +0900 From: bt22kawamotok To: "Drouvot, Bertrand" Cc: PostgreSQL Hackers Subject: Re: Query Jumbling for CALL and SET utility statements In-Reply-To: References: <46ca04f9-1e37-c862-9a28-c5dffaee412f@amazon.com> <20220831190604.l2luuhj3xkau7dvk@awork3.anarazel.de> <09c04aba-7f12-e524-20f7-3f92c1479fdf@amazon.com> <9aee54f2-5cc1-5b64-1f73-6961932e7bd2@amazon.com> <20220908065012.l3bd2np7wj52cxco@jrouhaud> <20220908112919.2ytxpkitiw6lt2u6@jrouhaud> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <88c16ab86e915ea8a33d3b62522f5537@oss.nttdata.com> X-Sender: bt22kawamotok@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > Attached v5 to normalize 2PC commands too, so that we get things like: > > > create table test_tx (a int); > begin; > prepare transaction 'tx1'; > insert into test_tx values (1); > commit prepared 'tx1'; > begin; > prepare transaction 'tx2'; > insert into test_tx values (2); > commit prepared 'tx2'; > begin; > prepare transaction 'tx3'; > insert into test_tx values (3); > rollback prepared 'tx3'; > begin; > prepare transaction 'tx4'; > insert into test_tx values (4); > rollback prepared 'tx4'; > SELECT query, calls, rows FROM pg_stat_statements ORDER BY query > COLLATE "C"; > query > | calls | rows > ------------------------------------------------------------------------------+-------+------ > SELECT pg_stat_statements_reset() > | 1 | 1 > SELECT query, calls, rows FROM pg_stat_statements ORDER BY query > COLLATE "C" | 0 | 0 > begin > | 4 | 0 > commit prepared $1 > | 2 | 0 > create table test_tx (a int) > | 1 | 0 > insert into test_tx values ($1) > | 4 | 4 > prepare transaction $1 > | 4 | 0 > rollback prepared $1 > | 2 | 0 > (8 rows) > > For those ones I also had to do some minor changes in gram.y and to > the TransactionStmt struct to record the gid location. Thanks Bertrand. I used your patch. It's looks very good. I found that utility statement is counted separately in upper and lower case. For example BEGIN and begin are counted separately. Is it difficult to fix this problem? Regards, Kotaro Kawamoto