diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-21 19:43:59 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-21 19:44:32 -0400 |
commit | 9cbc4b80ddc10b36c64514104caa69747c386dcf (patch) | |
tree | 56ff643469573d7f83c9bbc89ab44b797ab988cd /src/include/optimizer/paths.h | |
parent | 08af1a0a2ae8fbbd9949d9fa0f7583f6c09cf4ec (diff) |
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.
Diffstat (limited to 'src/include/optimizer/paths.h')
-rw-r--r-- | src/include/optimizer/paths.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index 8091b08234d..88ab4630fea 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -49,9 +49,6 @@ extern List *generate_bitmap_or_paths(PlannerInfo *root, RelOptInfo *rel, extern bool relation_has_unique_index_for(PlannerInfo *root, RelOptInfo *rel, List *restrictlist, List *exprlist, List *oprlist); -extern bool eclass_member_matches_indexcol(EquivalenceClass *ec, - EquivalenceMember *em, - IndexOptInfo *index, int indexcol); extern bool match_index_to_operand(Node *operand, int indexcol, IndexOptInfo *index); extern void expand_indexqual_conditions(IndexOptInfo *index, @@ -99,6 +96,12 @@ extern bool have_join_order_restriction(PlannerInfo *root, * equivclass.c * routines for managing EquivalenceClasses */ +typedef bool (*ec_matches_callback_type) (PlannerInfo *root, + RelOptInfo *rel, + EquivalenceClass *ec, + EquivalenceMember *em, + void *arg); + extern bool process_equivalence(PlannerInfo *root, RestrictInfo *restrictinfo, bool below_outer_join); extern Expr *canonicalize_ec_expression(Expr *expr, @@ -126,10 +129,11 @@ extern void mutate_eclass_expressions(PlannerInfo *root, Node *(*mutator) (), void *context, bool include_child_exprs); -extern List *generate_implied_equalities_for_indexcol(PlannerInfo *root, - IndexOptInfo *index, - int indexcol, - Relids prohibited_rels); +extern List *generate_implied_equalities_for_column(PlannerInfo *root, + RelOptInfo *rel, + ec_matches_callback_type callback, + void *callback_arg, + Relids prohibited_rels); extern bool have_relevant_eclass_joinclause(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2); extern bool has_relevant_eclass_joinclause(PlannerInfo *root, |