Re: plan shape work

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Alexandra Wang <alexandra.wang.oss@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, "bruce@momjian.us" <bruce@momjian.us>, lepihov@gmail.com
Date: 2025-09-29T02:41:47Z
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 →
  1. Assign each subquery a unique name prior to planning it.

  2. Keep track of what RTIs a Result node is scanning.

Richard Guo <guofenglinux@gmail.com> writes:
> On Fri, Sep 26, 2025 at 11:23 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> As an example of edge cases that your idea introduces, what happens
>> if a user-written subquery name is "expr_999999999999999999999999"
>> and then we need to generate a unique name based on "expr"?  Now
>> we have an integer-overflow situation to worry about, with possibly
>> platform-dependent results.

> I'd argue that this hypothetical edge case can be resolved with a bit
> of canonicalization in how subplan names are represented internally.

[ raised eyebrow... ]  How did you get to that from the complaint
that Robert's patch was not obviously bug-free?  (A complaint I
thought was unmerited, but nevermind.)  This proposal is neither
simple, nor obviously bug-free.  Moreover, in view of comments
upthread, I think we should look with great suspicion on any
proposal that involves changing user-supplied subquery aliases
unnecessarily.

			regards, tom lane