1/*-------------------------------------------------------------------------
4 * prototypes for restrictinfo.c.
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/optimizer/restrictinfo.h
12 *-------------------------------------------------------------------------
20/* Convenience macro for the common case of a valid-everywhere qual */
21 #define make_simple_restrictinfo(root, clause) \
22 make_restrictinfo(root, clause, true, false, false, false, 0, \
34 Relids incompatible_relids,
44 Relids incompatible_relids,
63 * clause_sides_match_join
64 * Determine whether a join clause is of the right form to use in this join.
66 * We already know that the clause is a binary opclause referencing only the
67 * rels in the current join. The point here is to check whether it has the
68 * form "outerrel_expr op innerrel_expr" or "innerrel_expr op outerrel_expr",
69 * rather than mixing outer and inner vars on either side. If it matches,
70 * we set the transient flag outer_is_left to identify which side is which.
79 /* lefthand side is outer */
80 rinfo->outer_is_left =
true;
86 /* righthand side is outer */
87 rinfo->outer_is_left =
false;
90 return false;
/* no good for these input relations */
93#endif /* RESTRICTINFO_H */
bool bms_is_subset(const Bitmapset *a, const Bitmapset *b)
static bool clause_sides_match_join(RestrictInfo *rinfo, Relids outerrelids, Relids innerrelids)
bool restriction_is_or_clause(RestrictInfo *restrictinfo)
List * extract_actual_clauses(List *restrictinfo_list, bool pseudoconstant)
void extract_actual_join_clauses(List *restrictinfo_list, Relids joinrelids, List **joinquals, List **otherquals)
bool restriction_is_securely_promotable(RestrictInfo *restrictinfo, RelOptInfo *rel)
RestrictInfo * make_plain_restrictinfo(PlannerInfo *root, Expr *clause, Expr *orclause, bool is_pushed_down, bool has_clone, bool is_clone, bool pseudoconstant, Index security_level, Relids required_relids, Relids incompatible_relids, Relids outer_relids)
List * get_actual_clauses(List *restrictinfo_list)
bool join_clause_is_movable_into(RestrictInfo *rinfo, Relids currentrelids, Relids current_and_outer)
bool join_clause_is_movable_to(RestrictInfo *rinfo, RelOptInfo *baserel)
RestrictInfo * make_restrictinfo(PlannerInfo *root, Expr *clause, bool is_pushed_down, bool has_clone, bool is_clone, bool pseudoconstant, Index security_level, Relids required_relids, Relids incompatible_relids, Relids outer_relids)
RestrictInfo * commute_restrictinfo(RestrictInfo *rinfo, Oid comm_op)