Re: postgres_fdw: wrong results with self join + enable_nestloop off

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Nishant Sharma <nishant(dot)sharma(at)enterprisedb(dot)com>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, Suraj Kharage <suraj(dot)kharage(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: postgres_fdw: wrong results with self join + enable_nestloop off
Date: 2023-06-08 10:36:48
Message-ID: CAPmGK15zHnpQ4cf0Ffy=tG9jh9GK6k8HjRYFYUEykUJMBE5=OQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Jun 7, 2023 at 7:28 PM Nishant Sharma
<nishant(dot)sharma(at)enterprisedb(dot)com> wrote:
> Etsuro's patch is also showing the correct output for "set enable_nestloop=off". Looks good to me for back branches due to backport issues.
>
> But below are a few observations for the same:-
> 1) I looked into the query plan for both "set enable_nestloop" on & off case and observe that they are the same. That is, what we see with "set enable_nestloop=on".
> 2) In back branches for "set enable_nestloop" on & off value, at least this type of query execution won't make any difference. No comparison of plans to be selected based on total cost of two plans old (Nested Loop with Foreign Scans) & new (Only Foreign Scan) will be done, because we are avoiding the call to "postgresGetForeignJoinPaths()" up front when we have pseudo constants.

Thanks for looking!

Best regards,
Etsuro Fujita

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-06-08 10:37:37 Re: Let's make PostgreSQL multi-threaded
Previous Message Etsuro Fujita 2023-06-08 10:30:52 Re: postgres_fdw: wrong results with self join + enable_nestloop off