public inbox for [email protected]  
help / color / mirror / Atom feed
From: wenhui qiu <[email protected]>
To: Richard Guo <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: Clean up remove_rel_from_query() after self-join elimination commit
Date: Mon, 20 Apr 2026 08:49:25 +0800
Message-ID: <CAGjGUALwC9uRxqvmQSk9Cg5VR2qewTuKe+=seXmynPP4PwFsDQ@mail.gmail.com> (raw)
In-Reply-To: <CAMbWs48RYf3dDS4P+HC43x-KLrN0uF-aU-Mk0Ld5JoWGErOqUg@mail.gmail.com>
References: <CAMbWs48JC4OVqE=3gMB6se2WmRNNfMyFyYxm-09vgpm+Vwe8Hg@mail.gmail.com>
	<[email protected]>
	<CAGjGUAKZ-gaT6z=4_BR8J5Xq7c85ckWuZ3_sHUo6oseto6npHA@mail.gmail.com>
	<CAMbWs48RYf3dDS4P+HC43x-KLrN0uF-aU-Mk0Ld5JoWGErOqUg@mail.gmail.com>

Hi Richard
> Assert(!is_outer_join || joinrelids != NULL);

> Worth asserting.  If a caller sets sjinfo but passes NULL for
> joinrelids, this would silently over-delete PHVs.
> Assert(!is_self_join || joinrelids == NULL);

LGTM with the added assertion. Thanks again for all the heavy lifting
you're doing on the Postgres optimizer

> I prefer to not add this one.  It's not defending any invariant.
Thank you for your explanation ,


Thanks

On Sat, Apr 18, 2026 at 6:17 PM Richard Guo <[email protected]> wrote:

> On Tue, Apr 7, 2026 at 6:57 PM wenhui qiu <[email protected]> wrote:
> > Assert(!is_outer_join || joinrelids != NULL);
>
> Worth asserting.  If a caller sets sjinfo but passes NULL for
> joinrelids, this would silently over-delete PHVs.
>
> > Assert(!is_self_join || joinrelids == NULL);
>
> I prefer to not add this one.  It's not defending any invariant.
>
> - Richard
>


view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Clean up remove_rel_from_query() after self-join elimination commit
  In-Reply-To: <CAGjGUALwC9uRxqvmQSk9Cg5VR2qewTuKe+=seXmynPP4PwFsDQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox