Re: Foreign join pushdown vs EvalPlanQual - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Foreign join pushdown vs EvalPlanQual
Date
Msg-id CA+TgmobmzCcnaaWh1d3nRytsgBb8tAkZE2b6PR7+Yi-aadjOZQ@mail.gmail.com
Whole thread Raw
In response to Re: Foreign join pushdown vs EvalPlanQual  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Responses Re: Foreign join pushdown vs EvalPlanQual  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
List pgsql-hackers
On Fri, Nov 20, 2015 at 12:11 AM, Kouhei Kaigai <kaigai@ak.jp.nec.com> wrote:
>> On Thu, Nov 19, 2015 at 6:39 AM, Kouhei Kaigai <kaigai@ak.jp.nec.com> wrote:
>> > So, are you suggesting to make a patch that allows ForeignScan to have
>> > multiple sub-plans right now? Or, one sub-plan?
>>
>> Two:
>>
>> http://www.postgresql.org/message-id/CA+TgmoYZeje+ot1kX4wdoB7R7DPS0CWXAzfqZ-
>> 14yKfkgKREAQ@mail.gmail.com
>>
> Hmm. Two is a bit mysterious for me because two sub-plans (likely)
> means this ForeignScan node checks join clauses and reconstruct
> a joined tuple by itself but does not check scan clauses pushed-
> down (it is job of inner/outer scan plan, isn't it?).
> In this case, how do we treat N-way remote join cases (N>2) if we
> assume such a capability in FDW driver?
>
> One subplan means FDW driver run an entire join sub-tree with local
> alternative sub-plan; that is my expectation for the majority case.
> However, I cannot explain two subplans, but not multiple, well.

What I'm imagining is that we'd add handling that allows the
ForeignScan to have inner and outer children.  If the FDW wants to
delegate the EvalPlanQual handling to a local plan, it can use the
outer child for that.  Or the inner one, if it likes.  The other one
is available for some other purposes which we can't imagine yet.  If
this is too weird, we can only add handling for an outer subplan and
forget about having an inner subplan for now.  I just thought to make
it symmetric, since outer and inner subplans are pretty deeply baked
into the structure of the system.

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



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: custom function for converting human readable sizes to bytes
Next
From: Robert Haas
Date:
Subject: Re: [PROPOSAL] VACUUM Progress Checker.