Re: Join push-down support for foreign tables - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Join push-down support for foreign tables
Date
Msg-id CA+TgmobRWtufEmsd7hTknFJXqbscCcwaKT4F5ZzQeGZaLNngng@mail.gmail.com
Whole thread Raw
In response to Re: Join push-down support for foreign tables  (Shigeru Hanada <shigeru.hanada@gmail.com>)
Responses Re: Join push-down support for foreign tables  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Wed, Mar 4, 2015 at 4:26 AM, Shigeru Hanada <shigeru.hanada@gmail.com> wrote:
> Here is v4 patch of Join push-down support for foreign tables.  This
> patch requires Custom/Foreign join patch v7 posted by Kaigai-san.

Hi,

I just want to point out to the folks on this thread that the action
in this area is happening on the other thread, about the
custom/foreign join patch, and that Tom and I are suspecting that we
do not have the right design here.  Your input is needed.

From my end, I am quite skeptical about the way
postgresGetForeignJoinPath in this patch works.  It looks only at the
cheapest total path of the relations to be joined, which seems like it
could easily be wrong.  What about some other path that is more
expensive but provides a convenient sort order?  What about something
like A LEFT JOIN (B JOIN C ON B.x = C.x) ON A.y = B.y AND A.z = C.z,
which can't make a legal join until level 3?  Tom's proposed hook
placement would instead invoke the FDW once per joinrel, passing root
and the joinrel.  Then, you could cost a path based on the idea of
pushing that join entirely to the remote side, or exit without doing
anything if pushdown is not feasible.

Please read the other thread and then respond either there or here
with thoughts on that design.  If you don't provide some input on
this, both of these patches are going to get rejected as lacking
consensus, and we'll move on to other things.  I'd really rather not
ship yet another release without this important feature, but that's
where we're heading if we can't talk this through.

Thanks,

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Next
From: Kevin Grittner
Date:
Subject: Re: Reduce pinning in btree indexes