Re: plan shape work
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alexandra Wang <alexandra.wang.oss@gmail.com>,
Richard Guo <guofenglinux@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
"bruce@momjian.us" <bruce@momjian.us>, lepihov@gmail.com
Date: 2025-09-26T01:53:30Z
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 →
-
Assign each subquery a unique name prior to planning it.
- 8c49a484e8eb 19 (unreleased) landed
-
Keep track of what RTIs a Result node is scanning.
- f2bae51dfd5b 19 (unreleased) landed
Robert Haas <robertmhaas@gmail.com> writes: > But maybe there's still some way to improve this. It would probably be > hard to make it perfect because of the fact that EXPLAIN names are > unique across all relations in the query, as noted above. However, we > might be able to make it so the names match in the absence of name > conflicts with user specified aliases or table names. Or maybe we > should consider some larger change to the EXPLAIN format so that we > display subquery names instead of relation names. I'm kind of down on that last idea, because relation names/aliases are user-supplied or at least user-suppliable, whereas what choose_plan_name() generates is not under user control. So if we try to make this match, it should be in the direction of using the parent query's subquery alias whenever possible. But I fear that it'll be hard to make this match up exactly unless we choose to take the selection of unique relation aliases out of EXPLAIN altogether and make the planner do it. Which seems like a bad idea, because then we're paying that cost all the time, and it's not small for big queries. regards, tom lane