Re: The bogus calls in remove_self_join_rel()

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: The bogus calls in remove_self_join_rel()
Date: 2026-04-23 08:11:06
Message-ID: e0e6ad26-b3a0-4375-be0b-dc291534fbae@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23/04/2026 04:45, Richard Guo wrote:
> I noticed these two calls in remove_self_join_rel():
>
> adjust_relid_set(root->all_result_relids, toRemove->relid, toKeep->relid);
> adjust_relid_set(root->leaf_result_relids, toRemove->relid, toKeep->relid);
>
> There's no comment explaining them, and as far as I can tell they do
> nothing: adjust_relid_set returns a Relids and does not modify the
> input in place.
There is a clear history of these calls. When designing SJE, we initially
applied it to partitioned tables. Later, we realised complicated issues arise
when SJE meets DML, the RETURNING clause, and partitioned tables. So, we reduced
the feature for some time. I guess the core code's stability has been proven
enough by PG18. We may introduce SJE over partitioned tables in the next release.

You can probably remove these calls for now. Just make sure to add assertions to
help with developing the partitioned case.

--
regards, Andrei Lepikhov,
pgEdge

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-04-23 08:15:40 Re: PoC: Add condition variable support to WaitEventSetWait()
Previous Message Richard Guo 2026-04-23 07:58:46 Re: The bogus calls in remove_self_join_rel()