Re: [HACKERS] postgres_fdw bug in 9.6 - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: [HACKERS] postgres_fdw bug in 9.6
Date
Msg-id c4d6d586-80cd-4328-7d92-0ea7a6b380d2@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] postgres_fdw bug in 9.6  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] postgres_fdw bug in 9.6  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
List pgsql-hackers
On 2016/12/16 1:39, Tom Lane wrote:
> Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp> writes:
>> On 2016/12/13 23:13, Ashutosh Bapat wrote:
>>> A possible short-term fix may be this: instead of picking any random
>>> path to stick into fdw_outerpath, we choose a path which covers the
>>> pathkeys of ForeignPath.

>> Seems reasonable.

> No, because GetExistingLocalJoinPath is called once per relation not once
> per path.  Even if we were willing to eat the overhead of calling it once
> per path, we'd have to give up considering foreign paths with sort orders
> that there wasn't any cheap way to produce locally.

Hmm, I agree on that point that giving it up might result in a bad plan.

As I said upthread, an alternative I am thinking is (1) to create an 
equivalent nestloop join path using inner/outer paths of a foreign join 
path, except when that join path implements a full join, in which case a 
merge/hash join path is used, (2) store it in fdw_outerpath as-is, and 
(3) during an EPQ recheck, apply postgresRecheckForeignScan to the outer 
subplan created from the fdw_outerpath as-is.  What do you think about that?

Best regards,
Etsuro Fujita





pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_authid.rolpassword format (was Re: [HACKERS] Passwordidentifiers, protocol aging and SCRAM protocol)
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Quorum commit for multiple synchronous replication.