Re: FDW: ForeignPlan and parameterized paths - Mailing list pgsql-hackers

From Tom Lane
Subject Re: FDW: ForeignPlan and parameterized paths
Date
Msg-id 20038.1355943805@sss.pgh.pa.us
Whole thread Raw
In response to FDW: ForeignPlan and parameterized paths  (Ronan Dunklau <rdunklau@gmail.com>)
Responses Re: FDW: ForeignPlan and parameterized paths  (Ronan Dunklau <rdunklau@gmail.com>)
List pgsql-hackers
Ronan Dunklau <rdunklau@gmail.com> writes:
> I've noticed that,  when implementing a FDW, it is difficult to use a plan which 
> best path is a parameterized path. This comes from the fact that the 
> parameterized clause is not easily available at plan time.

> This is what I understood from how it works:

> - The clauses coming from the best path restrictinfo are not available in the 
> scan_clauses argument to the GetForeignPlan function.

> - They are, however, directly available on the path, but at this point the 
> clauses are of the form InnerVar OPERATOR OuterVar. The outer Var node is then 
> replaced by a Param node, using the replace_nestloop_params function.

> It could be useful to make the "parameterized" version of the clause (in the 
> form InnerVar OPERATOR Param) available to the fdw at plan time.

> Could this be possible ?

I intentionally did the nestloop_params substitution after calling
GetForeignPlan not before.  It's not apparent to me why it would be
useful to do it before, because the FDW is going to have no idea what
those params represent.  (Note that they represent values coming from
some other, probably local, relation; not from the foreign table.)
        regards, tom lane



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Review of Row Level Security
Next
From: "Kevin Grittner"
Date:
Subject: Re: Review of Row Level Security