diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/nodes/pathnodes.h | 17 | ||||
| -rw-r--r-- | src/include/optimizer/pathnode.h | 1 | ||||
| -rw-r--r-- | src/include/optimizer/paths.h | 5 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h index 7d4f24d2508..23dd671bf4e 100644 --- a/src/include/nodes/pathnodes.h +++ b/src/include/nodes/pathnodes.h @@ -2783,11 +2783,15 @@ typedef struct PlaceHolderVar * 3, when this join is in the RHS of the upper join (so, this is the lower * join in the second form of the identity). * - * commute_below is filled with the relids of syntactically-lower outer joins - * that have been found to commute with this one per outer join identity 3. - * (We need not record which side they are on, since that can be determined - * by seeing whether the lower join's relid appears in syn_lefthand or - * syn_righthand.) + * commute_below_l is filled with the relids of syntactically-lower outer + * joins that have been found to commute with this one per outer join identity + * 3 and are in the LHS of this join (so, this is the upper join in the first + * form of the identity). + * + * commute_below_r is filled with the relids of syntactically-lower outer + * joins that have been found to commute with this one per outer join identity + * 3 and are in the RHS of this join (so, this is the upper join in the second + * form of the identity). * * lhs_strict is true if the special join's condition cannot succeed when the * LHS variables are all NULL (this means that an outer join can commute with @@ -2829,7 +2833,8 @@ struct SpecialJoinInfo Index ojrelid; /* outer join's RT index; 0 if none */ Relids commute_above_l; /* commuting OJs above this one, if LHS */ Relids commute_above_r; /* commuting OJs above this one, if RHS */ - Relids commute_below; /* commuting OJs below this one */ + Relids commute_below_l; /* commuting OJs in this one's LHS */ + Relids commute_below_r; /* commuting OJs in this one's RHS */ bool lhs_strict; /* joinclause is strict for some LHS rel */ /* Remaining fields are set only for JOIN_SEMI jointype: */ bool semi_can_btree; /* true if semi_operators are all btree */ diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h index 69be701b167..001e75b5b76 100644 --- a/src/include/optimizer/pathnode.h +++ b/src/include/optimizer/pathnode.h @@ -311,6 +311,7 @@ extern RelOptInfo *build_join_rel(PlannerInfo *root, RelOptInfo *outer_rel, RelOptInfo *inner_rel, SpecialJoinInfo *sjinfo, + List *pushed_down_joins, List **restrictlist_ptr); extern Relids min_join_parameterization(PlannerInfo *root, Relids joinrelids, diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index 5b9db7733d2..50bc3b503a6 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -104,6 +104,9 @@ extern void add_paths_to_joinrel(PlannerInfo *root, RelOptInfo *joinrel, extern void join_search_one_level(PlannerInfo *root, int level); extern RelOptInfo *make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2); +extern Relids add_outer_joins_to_relids(PlannerInfo *root, Relids input_relids, + SpecialJoinInfo *sjinfo, + List **pushed_down_joins); extern bool have_join_order_restriction(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2); extern bool have_dangerous_phv(PlannerInfo *root, @@ -150,7 +153,7 @@ extern List *generate_join_implied_equalities(PlannerInfo *root, Relids join_relids, Relids outer_relids, RelOptInfo *inner_rel, - Index ojrelid); + SpecialJoinInfo *sjinfo); extern List *generate_join_implied_equalities_for_ecs(PlannerInfo *root, List *eclasses, Relids join_relids, |
