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

From Robert Haas
Subject Re: Foreign join pushdown vs EvalPlanQual
Date
Msg-id CA+TgmoaAzs0dR23R7PTBseQfwOtuVCPNBqDHxeBo9Gi+dMxj8w@mail.gmail.com
Whole thread Raw
In response to Re: Foreign join pushdown vs EvalPlanQual  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
Responses Re: Foreign join pushdown vs EvalPlanQual
List pgsql-hackers
On Thu, Sep 3, 2015 at 6:25 AM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.jp> wrote:
> I gave it another thought; the following changes to ExecInitNode would make
> the patch much simpler, ie, we would no longer need to call the new code in
> ExecInitForeignScan, ExecForeignScan, ExecEndForeignScan, and
> ExecReScanForeignScan.  I think that would resolve the name problem also.
>
> *** a/src/backend/executor/execProcnode.c
> --- b/src/backend/executor/execProcnode.c
> ***************
> *** 247,254 **** ExecInitNode(Plan *node, EState *estate, int eflags)
>             break;
>
>         case T_ForeignScan:
> !           result = (PlanState *) ExecInitForeignScan((ForeignScan *) node,
> !                                                      estate, eflags);
>             break;
>
>         case T_CustomScan:
> --- 247,269 ----
>             break;
>
>         case T_ForeignScan:
> !           {
> !               Index       scanrelid = ((ForeignScan *)
> node)->scan.scanrelid;
> !
> !               if (estate->es_epqTuple != NULL && scanrelid == 0)
> !               {
> !                   /*
> !                    * We are in foreign join inside an EvalPlanQual
> recheck.
> !                    * Initialize local join execution plan, instead.
> !                    */
> !                   Plan       *subplan = ((ForeignScan *)
> node)->fs_subplan;
> !
> !                   result = ExecInitNode(subplan, estate, eflags);
> !               }
> !               else
> !                   result = (PlanState *) ExecInitForeignScan((ForeignScan
> *) node,
> !                                                              estate,
> eflags);
> !           }
>             break;

I don't think that's a good idea.  The Plan tree and the PlanState
tree should be mirror images of each other; breaking that equivalence
will cause confusion, at least.

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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: RLS open items are vague and unactionable
Next
From: Robert Haas
Date:
Subject: Re: Foreign join pushdown vs EvalPlanQual