Re: [PATCH] Optionally record Plan IDs to track plan changes for a query

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Lukas Fittl <lukas(at)fittl(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Marko M <marko(at)pganalyze(dot)com>
Subject: Re: [PATCH] Optionally record Plan IDs to track plan changes for a query
Date: 2025-02-07 01:52:53
Message-ID: CAA5RZ0u6yJdFL=p5vdpbZFS-2YY+Z6vtzmt4gejgZa3RcNiWMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> This does not yet move field-specific comments to their own line in nodes where we're adding node attributes, I'll leave that for Sami to work on.
>

Hi,

Attached is a new set of patches for fixing the long comments
in plannodes.h and to refactor queryjumblefuncs.c

v5-0001
-----------

This fixes the long comments in plannodes.h to make it easier to add the
attribute annotation. It made the most sense to make this the first patch
in the set.

v5-0002
-----------
>> Here are my high-level thoughts on this:
>> 1. rename queryjumblefuncs.c to jumblefuncs.c

> If these APIs are used for somethings else than Query structure, yes,
> the renaming makes sense.

Done. Also rewrote the header comment in jumblefuncs.c to describe
a more generic node jumbling mechanism that this file now offers.

>> 2. move the query jumbling related code to parser/analyze.c,
>> since query jumbling occurs there during parsing.

> Not sure about this one. It depends on how much is changed. As long
> as everything related to the nodes stays in src/backend/nodes/,
> perhaps that's OK.

Yes, after getting my hands on this, I agree with you. It made more sense
to keep all the jumbling work in jumblefuncs.c

v5-0003 and v5-0004 introduce the planId in core and pg_stat_plans. These
needed rebasing only; but I have not yet looked at this thoroughly.

We should aim to get 0001 and 0002 committed next.

Regards,

Sami

Attachment Content-Type Size
v5-0002-Allow-using-jumbling-logic-outside-of-query-jumbl.patch application/octet-stream 18.8 KB
v5-0001-reformat-comments-in-plannode.h.patch application/octet-stream 23.4 KB
v5-0004-Add-pg_stat_plans-contrib-extension.patch application/octet-stream 71.0 KB
v5-0003-Optionally-record-a-plan_id-in-PlannedStmt-to-ide.patch application/octet-stream 43.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2025-02-07 02:16:02 RE: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Previous Message Michael Paquier 2025-02-07 00:47:53 Re: Show WAL write and fsync stats in pg_stat_io