Re: Multiple Query IDs for a rewritten parse tree - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Multiple Query IDs for a rewritten parse tree
Date
Msg-id 20220109121321.3d74krhjbr5mp4zv@jrouhaud
Whole thread Raw
In response to Re: Multiple Query IDs for a rewritten parse tree  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Multiple Query IDs for a rewritten parse tree
List pgsql-hackers
On Sat, Jan 08, 2022 at 07:49:59PM -0500, Tom Lane wrote:
>
> The idea I'd been vaguely thinking about is to allow attaching a list
> of query-hash nodes to a Query, where each node would contain a "tag"
> identifying the specific hash calculation method, and also the value
> of the query's hash calculated according to that method.

For now the queryid mixes two different things: fingerprinting and query text
normalization.  Should each calculation method be allowed to do a different
normalization too, and if yes where should be stored the state data needed for
that?  If not, we would need some kind of primary hash for that purpose.

Looking at Andrey's use case for wanting multiple hashes, I don't think that
adaptive optimization needs a normalized query string.  The only use would be
to output some statistics, but this could be achieved by storing a list of
"primary queryid" for each adaptive entry.  That's probably also true for
anything that's not monitoring intended.  Also, all monitoring consumers should
probably agree on the same queryid, both fingerprint and normalized string, as
otherwise it's impossible to cross-reference metric data.



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Multiple Query IDs for a rewritten parse tree
Next
From: Zhihong Yu
Date:
Subject: Re: null iv parameter passed to combo_init()