Re: Join removal and attr_needed cleanup - Mailing list pgsql-hackers

From Bennie Swart
Subject Re: Join removal and attr_needed cleanup
Date
Msg-id 68050f74-e384-451e-a489-8c076ba0513c@gmail.com
Whole thread Raw
In response to Re: Join removal and attr_needed cleanup  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Given that some time has passed I'd like to raise this again. Any chance 
of this making it back to 16 to fix the regression?

We'll be using 16 for the better part of a year still and we're having 
to resort to some annoying workarounds for this.

Regards,

Bennie

On 2024/11/10 18:17, Tom Lane wrote:
> Bennie Swart <bennieswart@gmail.com> writes:
>> -- join elimination fails
>> -- expect both b and c to be eliminated, but b remains
>> explain (costs off)
>>     select a.*
>>       from foo a
>>         left join foo b on (b.id1, b.id2) = (a.id1, a.id2)
>>         left join foo c on (c.id1, c.id2) = (a.id1, b.id2);
>>                                          -- ^^^^^^^^^^^^^^
>
> This does work in HEAD, presumably as a consequence of a3179ab69:
>
> regression=# explain (costs off)
>     select a.*
>       from foo a
>         left join foo b on (b.id1, b.id2) = (a.id1, a.id2)
>         left join foo c on (c.id1, c.id2) = (a.id1, b.id2);
>      QUERY PLAN
> -------------------
>   Seq Scan on foo a
> (1 row)
>
> I think it's still too soon to consider back-patching that though,
> since it's only been in the tree for six weeks.
>
>             regards, tom lane




pgsql-hackers by date:

Previous
From: "Scott Mead"
Date:
Subject: Re: Disable parallel query by default
Next
From: Tom Lane
Date:
Subject: Re: Violation of principle that plan trees are read-only