76{
78
79 /* Examine each baserel for potential join OR clauses */
80 for (rti = 1; rti <
root->simple_rel_array_size; rti++)
81 {
84
85 /* there may be empty slots corresponding to non-baserel RTEs */
86 if (rel == NULL)
87 continue;
88
89 Assert(rel->
relid == rti);
/* sanity check on array */
90
91 /* ignore RTEs that are "other rels" */
93 continue;
94
95 /*
96 * Find potentially interesting OR joinclauses. We can use any
97 * joinclause that is considered safe to move to this rel by the
98 * parameterized-path machinery, even though what we are going to do
99 * with it is not exactly a parameterized path.
100 */
102 {
104
107 {
108 /* Try to extract a qual for this rel only */
110
111 /*
112 * If successful, decide whether we want to use the clause,
113 * and insert it into the rel's restrictinfo list if so.
114 */
115 if (orclause)
117 }
118 }
119 }
120}
Assert(PointerIsAligned(start, uint64))
static void consider_new_or_clause(PlannerInfo *root, RelOptInfo *rel, Expr *orclause, RestrictInfo *join_or_rinfo)
static Expr * extract_or_clause(RestrictInfo *or_rinfo, RelOptInfo *rel)
bool restriction_is_or_clause(RestrictInfo *restrictinfo)
bool join_clause_is_movable_to(RestrictInfo *rinfo, RelOptInfo *baserel)