pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: marcus.kempe@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17668: Query normalization generates multiple queryId:s for calls to the same procedure
Date: Fri, 28 Oct 2022 00:08:34 +0800
Message-ID: <20221027160834.uxhmt473grlpfv5x@jrouhaud> (raw)
In-Reply-To: <17668-e25abc1f5375b095@postgresql.org>
References: <17668-e25abc1f5375b095@postgresql.org>

Hi,

On Thu, Oct 27, 2022 at 01:49:18PM +0000, PG Bug reporting form wrote:
>
> postgres=# select calls,userid,dbid,queryid,query from
> public.pg_stat_statements where query like 'select test%';
>  calls | userid | dbid  |       queryid        |      query
> -------+--------+-------+----------------------+-----------------
>      1 |     10 | 13757 | -8729651821477628722 | select test($1)
>      1 |     10 | 13757 |  1452143938866253601 | select test($1)
> (2 rows)
>
> So given the above 2 calls for the same function, there are 2 different
> queryIds generated, seemingly based on the fact that in the first case the
> parameter can be cast to integer, and in the second case it can not.
>
> I would have expected both calls to be normalized and fingerprinted to one
> and the same queryId.

Agreed, and that's actually a known problem that is currently being worked on.
You can look at
https://www.postgresql.org/message-id/flat/36e5bffe-e989-194f-85c8-06e7bc88e6f7%40amazon.com
for details about the discussion and in-progress fix.





view thread (6+ messages)  latest in thread

Message-ID: <20221027160834.uxhmt473grlpfv5x@jrouhaud>
Permalink:  ../20221027160834.uxhmt473grlpfv5x@jrouhaud/
Also on:    postgresql.org/message-id/20221027160834.uxhmt473grlpfv5x@jrouhaud

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: rjuju123@gmail.com, marcus.kempe@gmail.com
  Subject: Re: BUG #17668: Query normalization generates multiple queryId:s for calls to the same procedure
  In-Reply-To: <20221027160834.uxhmt473grlpfv5x@jrouhaud>
  References: <17668-e25abc1f5375b095@postgresql.org> <20221027160834.uxhmt473grlpfv5x@jrouhaud>

* 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