Re: postgres_fdw: wrong results with self join + enable_nestloop off - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: postgres_fdw: wrong results with self join + enable_nestloop off
Date
Msg-id CAPmGK16J-0OwjJejs629D_rwZzwB=1H5P7i7SJbw0BfEcguxQA@mail.gmail.com
Whole thread Raw
In response to Re: postgres_fdw: wrong results with self join + enable_nestloop off  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-hackers
Hi Richard,

On Tue, Jun 6, 2023 at 12:20 PM Richard Guo <guofenglinux@gmail.com> wrote:
> On Mon, Jun 5, 2023 at 9:19 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
>> To avoid this issue, I am wondering if we should modify
>> add_paths_to_joinrel() in back branches so that it just disallows the
>> FDW to consider pushing down joins when the restrictlist has
>> pseudoconstant clauses.  Attached is a patch for that.

> I think we can do that in back branches.  But I'm a little concerned
> that we'd miss a better plan if FDW cannot push down joins in such
> cases.  I may be worrying over nothing though if it's not common that
> the restrictlist has pseudoconstant clauses.

Yeah, it is unfortunate that we would not get better plans.  Given
that it took quite a long time to find this issue, I suppose that
users seldom do foreign joins with pseudoconstant clauses, though.

Anyway thanks for working on this, Richard!

Best regards,
Etsuro Fujita



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: running logical replication as the subscription owner
Next
From: Etsuro Fujita
Date:
Subject: Re: postgres_fdw: wrong results with self join + enable_nestloop off