Re: Refactor query normalization into core query jumbling - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Refactor query normalization into core query jumbling
Date
Msg-id aVNVouHQGFqFz6qu@paquier.xyz
Whole thread Raw
In response to Re: Refactor query normalization into core query jumbling  (Lukas Fittl <lukas@fittl.com>)
List pgsql-hackers
On Mon, Dec 29, 2025 at 06:34:18PM -0800, Lukas Fittl wrote:
> I noticed pg_hint_plan checks the JumbleState argument to determine whether
> or not to run an early check of the hint logic. I'm a little
> confused by this (and if this is about query IDs being available,
> couldn't it just check the  Query having a non-zero queryID?), but
> FWIW: [3]

See also the code before 32ced2e13e75.  We wanted a JumbleState in
this case to be able to generate a normalized query for the hint
table.  Since this commit we only rely on the query ID in the hint
table, so it would not matter for pg_hint_plan if the JumbleState is
removed from this portions of the hooks.

Saying that, yes I think that you are right, we should be able to
remove this dependency on JumbleState in
pg_hint_plan_post_parse_analyze() and rely on the query ID.  I'm
writing down a note about cleaning that on the HEAD branch of the
module..
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Assertion failure in SnapBuildInitialSnapshot()
Next
From: Michael Paquier
Date:
Subject: Re: Fix duplicated word in lsyscache.c comment