Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vWjoR-008ZA1-0n for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Dec 2025 23:23:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWjoO-009Hhh-0v for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Dec 2025 23:23:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vWjoN-009HhY-3C for pgsql-hackers@lists.postgresql.org; Fri, 19 Dec 2025 23:23:04 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vWjoM-001a8V-30 for pgsql-hackers@postgresql.org; Fri, 19 Dec 2025 23:23:03 +0000 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 611EDEC0195; Fri, 19 Dec 2025 18:23:01 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Fri, 19 Dec 2025 18:23:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1766186581; x=1766272981; bh=o+pUnW42x4 TOC9BuMG6BojrfnMKvjN1uSU/vNsdpQLQ=; b=tsMeoZao0ts+/Vq/gg/IeJ/TmP Q7mHaaZuEtlMcykzDIuFqoRVMb2h0Lhu3elSOf5fziFsVn5sRCh8YOPpHIPgI73/ 7WpkRPDqIDKE9WOrcgQ9Id+qQIdxpZdZTDEIKE07Mdyi1M1XtAZEK8I8ZY8DkSAp u2h3LaE/kDbardcgBZUIyucbP7A6A8z25/40EGH/vfze/63Q5bXHQ+hIEkEsGk+D 3o48P0wkbnK+5Jx2/2UNAqfLh8LBzLuFCUDEAorsqAfScs0Z36/hzbX6GSogkCAJ IS14eDnZLG3s+noMZIo0/us3eqPXJmQDnr1G7UrNdzC1Tofz52V8/UgsLc8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1766186581; x=1766272981; bh=o+pUnW42x4TOC9BuMG6BojrfnMKvjN1uSU/ vNsdpQLQ=; b=OlqmZSkB+PZu2fdL3lDX9MswopvzuVNX8UD+ZB9nh2ygvBEeher t56Qz0X/6tLSb20v3TBBgaoQZ1ClQFDNDbv3d2QD2Rl+JZDfloHoM3rcI7USC2qx 6clFfmkl74Al914IWRfDoxZmM2W8JMr5sEgeQ47MjhsLsGe03snkknIjTA0bWrWP 4kuM6tkJNrnq/hjH9hUTZrAaTghfWK6StX77Aclg/ISMzFwyLYh83m2s6ts3JAyt JZtPOTYPKHsZvbJn02HZAQfyqwMkVupfqJipYxotk7yCdRz9qY3O8Hec2gPD/F4K 2vUx6JCDlZ5tOG/KjonPt/kuT58ldF87kYg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdegleeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehsrghmih hmshgvihhhsehgmhgrihhlrdgtohhmpdhrtghpthhtohepsggvrhhtrhgrnhguughrohhu vhhothdrphhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvg hrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Dec 2025 18:22:59 -0500 (EST) Date: Sat, 20 Dec 2025 08:22:52 +0900 From: Michael Paquier To: Sami Imseih Cc: Bertrand Drouvot , pgsql-hackers Subject: Re: Refactor query normalization into core query jumbling Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BPgSBVckB1hRQeIE" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --BPgSBVckB1hRQeIE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 19, 2025 at 03:36:16PM -0600, Sami Imseih wrote: > This way, any extension that wishes to return a normalized string from > the same JumbleState can invoke this callback and get consistent results. > pg_stat_statements and other extensions with a need to normalize a query > string based on the locations of a JumbleState do not need to care about = the > internals of normalization, they simply invoke the callback and > receive the final > string. Hmm. I did not wrap completely my head with your problem, but, assuming that what you are proposing goes in the right direction, I am=20 wondering if we should not expose a bit more the jumble query APIs so as the normal default callback can be reused by out-of-core rather than hide it entirely. This would mean exposing GenerateNormalizedQuery(), which also giving a way for callers of JumbleQuery() to pass down a custom callback? This would imply thinking harder about the initialization state we expect in the structure, but I think that we should try to design things so as extensions do not need to copy-paste more code from the core tree at the end, just less of it. Of course, this sentence is written with the same line of thoughts as previously mentioned in the other thread we have discussed: extensions should not be allowed to update a JumbleState after it's been set by the backend code, so as once the same JumbleState pointer is passed down across multiple extensions they don't get confused. If an extension wants to use their own policy within the JumbleState, they had better recreate a new independent one if they are unhappy about has been generated previously. -- Michael --BPgSBVckB1hRQeIE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmlF3kwACgkQnvQgOdby QH19hBAAhsIi/wN2NtjFJ8vV7+ru05319iTglkahMpSRQ+zswnz4BslcTNBb5MxP 2KqgyoEivTvgagfCi1mtWf+Sw2zXX3OueRj/91uYRvSpavVi4Fk5uDuSK4rdLgso wdQOamS9yO1cGD2kfhfd+ER83xTr4+4mlKYUEd2w4Wtm1qZWIrICuTnn64MFMTLu bML7K6GKnOFgw5MdaCgJbqGlUgCi+JEEqSp50loBSBYxTrOu2Bj5PZU6CHzT50pO 7g6rXiqPNPn8igeg9ntVwYzFxWNxslJDaVHqrQMD8A0b8rbfiAWANisDvPup4Cwy 7UkUPp96cqoLK9vA0fOUw+CTKQcomaL5ZVUinjSfPFJ0tbEtexoS1falYMiSLoZU exmIb3BnJZZ5bKKWpiSZ+Qzl2pDpFDeuRkxjVa79YflHs/hP9AnjvR3yNgUA80TO Hjsun50N6vG/VeTq2LUlCXzKVK1x47NmEIIxUjd8XL+jZFpzoawgKU5DZtEtMM7w eQCaRBAdBmhYAJHVUV8gUtP5L66XbgULKgkdLn1FObYW7cX/DtS8bN+64WRS5J4I x/NnZBvdZWkXsYTPP0K2ieaEgQWLSViKYPvkkH/vDkyKUUN6W+F1I9JGpUVFQWeO ybwlXvBQAAL6C6Ct0lNpfTxE/MGKsE9hfJ55fD/ZEx2T1H9jGRU= =Rjsn -----END PGP SIGNATURE----- --BPgSBVckB1hRQeIE--