Re: Proposal - Allow extensions to set a Plan Identifier
Sami Imseih <samimseih@gmail.com>
From: Sami Imseih <samimseih@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Lukas Fittl <lukas@fittl.com>, Andrei Lepikhov <lepihov@gmail.com>, Bertrand Drouvot <bertranddrouvot.pg@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-03-24T23:47:59Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow plugins to set a 64-bit plan identifier in PlannedStmt
- 2a0cd38da5cc 18.0 landed
Attachments
- v1-0001-Allow-plugins-to-Jumble-an-expression.patch (application/octet-stream) patch v1-0001
> On Mon, Mar 24, 2025 at 02:36:05PM -0500, Sami Imseih wrote: > >> Ideally we can also land the jumble funcs work in the other thread > >> to allow extensions to re-use the > >> in-core logic for jumbling expressions found in plan node trees. > > > > IIUC, there should be a refactor I am working on at this moment to make that > > possible [0] > > That would be nice, thanks. As mentioned in [0], I spent some time thinking about making some of the core jumbling facilities available to plugins, and I have several patches to share. First, none of the changes change the names of the files from queryjumblefuncs.c to something more generic, as there was some resistance to that idea in this thread. I will keep it as is for now, and this can be revisited at a later time, if need be. So, v1-0001 provides the following to an extension: InitializeJumbleState - to initialize a jumble state JumbleNode - To jumble an expression HashJumbleState - To produce the 64-bit hash from the jumble state Also, an Assert was added inside RecordConstLocation to assert that the jumble state was initialized with record_clocations. I know it was mentioned above by both Michael and Andrei that AppendJumble should not be exposed. I am not sure I agree with that. I think it should be exposed, along with JUMBLE_FIELD, JUMBLE_FIELD_SINGLE and JUMBLE_STRING and _jumbleList. I am afraid that if we don't expose these routines/macros, the extension will have to re-invent those wheels. This is not included in v1-0001, but If there is no objection, I can update the patch. Thoughts? [0] https://www.postgresql.org/message-id/Z9khOo14yzZHCnmn%40paquier.xyz