Re: Removing unneeded self joins - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Removing unneeded self joins
Date
Msg-id CAPpHfdt57GeLokML7pYaecejV-VfHVDpVqbx-hTVswWmQ6nMTQ@mail.gmail.com
Whole thread Raw
In response to Re: Removing unneeded self joins  (Andrei Lepikhov <a.lepikhov@postgrespro.ru>)
Responses Re: Removing unneeded self joins
List pgsql-hackers
On Thu, Feb 22, 2024 at 10:51 AM Andrei Lepikhov
<a.lepikhov@postgrespro.ru> wrote:
> On 21/2/2024 14:26, Richard Guo wrote:
> > I think the right fix for these issues is to introduce a new element
> > 'sublevels_up' in ReplaceVarnoContext, and enhance replace_varno_walker
> > to 1) recurse into subselects with sublevels_up increased, and 2)
> > perform the replacement only when varlevelsup is equal to sublevels_up.
> This code looks good. No idea how we have lost it before.

Thanks to Richard for the patch and to Andrei for review.  I also find
code looking good.  Pushed with minor edits from me.

------
Regards,
Alexander Korotkov



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Running the fdw test from the terminal crashes into the core-dump
Next
From: Julien Rouhaud
Date:
Subject: Re: RangeTblEntry jumble omissions