mirror of
https://github.com/postgres/postgres.git
synced 2025-08-24 09:27:52 +03:00
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.
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user