pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: bt22kawamotok <bt22kawamotok@oss.nttdata.com>
To: Drouvot, Bertrand <bdrouvot@amazon.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Query Jumbling for CALL and SET utility statements
Date: Tue, 13 Sep 2022 11:43:52 +0900
Message-ID: <88c16ab86e915ea8a33d3b62522f5537@oss.nttdata.com> (raw)
In-Reply-To: <a0d66747-3f8c-5346-5baa-61299e2cb4da@amazon.com>
References: <46ca04f9-1e37-c862-9a28-c5dffaee412f@amazon.com>
	<20220831190604.l2luuhj3xkau7dvk@awork3.anarazel.de>
	<e43a0e02-4ef4-d510-a00a-cf39d2a9df19@amazon.com>
	<cbd28368-a5ae-f141-4c3f-28ba9f608ba0@amazon.com>
	<BBB9A13D-BBE2-44A4-9CA7-6E189120E5A2@amazon.com>
	<09c04aba-7f12-e524-20f7-3f92c1479fdf@amazon.com>
	<9aee54f2-5cc1-5b64-1f73-6961932e7bd2@amazon.com>
	<Yxl8R8mAUG2vqAcC@paquier.xyz>
	<20220908065012.l3bd2np7wj52cxco@jrouhaud>
	<c65f1c67-bae4-9658-9206-f11e9c6f7d11@amazon.com>
	<20220908112919.2ytxpkitiw6lt2u6@jrouhaud>
	<a16d303f-39ad-319c-18ff-85b78b106fe1@amazon.com>
	<a0d66747-3f8c-5346-5baa-61299e2cb4da@amazon.com>

> 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





view thread (45+ messages)  latest in thread

Message-ID: <88c16ab86e915ea8a33d3b62522f5537@oss.nttdata.com>
Permalink:  ../88c16ab86e915ea8a33d3b62522f5537@oss.nttdata.com/
Also on:    postgresql.org/message-id/88c16ab86e915ea8a33d3b62522f5537@oss.nttdata.com

 · 

reply

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: bt22kawamotok@oss.nttdata.com, bdrouvot@amazon.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Query Jumbling for CALL and SET utility statements
  In-Reply-To: <88c16ab86e915ea8a33d3b62522f5537@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