Redo postgres_fdw's planner code so it can handle parameterized paths.
Tom Lane <tgl@sss.pgh.pa.us>
Redo postgres_fdw's planner code so it can handle parameterized paths. I wasn't going to ship this without having at least some example of how to do that. This version isn't terribly bright; in particular it won't consider any combinations of multiple join clauses. Given the cost of executing a remote EXPLAIN, I'm not sure we want to be very aggressive about doing that, anyway. In support of this, refactor generate_implied_equalities_for_indexcol so that it can be used to extract equivalence clauses that aren't necessarily tied to an index.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/postgres_fdw/deparse.c | modified | +235 −164 |
| contrib/postgres_fdw/expected/postgres_fdw.out | modified | +22 −1 |
| contrib/postgres_fdw/postgres_fdw.c | modified | +591 −350 |
| contrib/postgres_fdw/postgres_fdw.h | modified | +7 −4 |
| contrib/postgres_fdw/sql/postgres_fdw.sql | modified | +4 −0 |
| src/backend/optimizer/path/equivclass.c | modified | +20 −15 |
| src/backend/optimizer/path/indxpath.c | modified | +29 −12 |
| src/include/optimizer/paths.h | modified | +11 −7 |