Re: PlaceholderVars and join removal with appendrel parents - Mailing list pgsql-hackers

From Richard Guo
Subject Re: PlaceholderVars and join removal with appendrel parents
Date
Msg-id CAMbWs4-fTg1j6S+HLgXzMcbJaQ8DKjWBMw=mg6hakdTynFaqZg@mail.gmail.com
Whole thread
In response to PlaceholderVars and join removal with appendrel parents  (Arne Roland <arne.roland@malkut.net>)
Responses Re: PlaceholderVars and join removal with appendrel parents
List pgsql-hackers
On Mon, Jul 13, 2026 at 7:23 PM Arne Roland <arne.roland@malkut.net> wrote:
> My idea would be to put a bitmapset into remove_rel_from_query with the
> seen ones and recurse removing it from the rinfo. I attached a sketch of
> my idea. But maybe our have a better one.

Thanks for the report and the patch.  I think the fix is on the right
track.  (BTW, the seen_serials bitmap is to avoid processing any join
clause more than once, the same trick used in rebuild_joinclause_attr_needed.)

I've made some cosmetic tweaks to the patch, added a commit message,
and included a test case, as attached.  I plan to push this soon,
barring any objections.

- Richard

Attachment

pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: REASSIGN OWNED vs. relisshared dep on !relisshared
Next
From: Andrei Lepikhov
Date:
Subject: Re: RFC: Logging plan of the running query