52 List *new_restrictlist);
133 Assert(child_relid < size);
136 elog(
ERROR,
"child relation already exists");
200 Assert(relid > 0 && relid < root->simple_rel_array_size);
202 elog(
ERROR,
"rel %d already exists", relid);
381 if (relid < root->simple_rel_array_size)
388 elog(
ERROR,
"no relation entry for relid %d", relid);
582 List **restrictlist_ptr)
601 if (restrictlist_ptr)
633 outer_rel, inner_rel);
711 outer_rel, inner_rel);
712 if (restrictlist_ptr)
713 *restrictlist_ptr = restrictlist;
730 sjinfo, restrictlist);
868 nappinfos, appinfos);
898 sjinfo, restrictlist);
915 parent_joinrel, joinrel);
997 elog(
ERROR,
"unexpected node type in rel targetlist: %d",
1125 List *joininfo_list,
1126 List *new_restrictlist)
1130 foreach(l, joininfo_list)
1154 return new_restrictlist;
1159 List *joininfo_list,
1167 foreach(l, joininfo_list)
1192 return new_joininfo;
1332 pclauses =
lappend(pclauses, rinfo);
1392 List **restrict_clauses)
1427 outer_and_req = NULL;
1432 inner_and_req = NULL;
1448 pclauses =
lappend(pclauses, rinfo);
1458 foreach(lc, eclauses)
1487 pclauses =
lappend(pclauses, rinfo);
1522 Relids real_outer_and_req;
1532 foreach(lc, eclauses)
1540 real_outer_and_req));
1545 pclauses =
lappend(pclauses, rinfo);
1554 *restrict_clauses =
list_concat(pclauses, *restrict_clauses);
1677 jointype, restrictlist))
1736 memset(pk_has_clause, 0,
sizeof(pk_has_clause));
1737 foreach(lc, restrictlist)
1818 pk_has_clause[ipk1] =
true;
1822 for (cnt_pks = 0; cnt_pks < part_scheme->
partnatts; cnt_pks++)
1824 if (!pk_has_clause[cnt_pks])
1909 for (
int cnt = 0; cnt < partnatts; cnt++)
1917 List *nullable_partexpr =
NIL;
1947 nullable_partexpr =
list_copy(outer_null_expr);
1961 nullable_partexpr =
list_concat(nullable_partexpr,
1974 nullable_partexpr =
list_concat(nullable_partexpr,
1976 nullable_partexpr =
list_concat(nullable_partexpr,
2012 nullable_partexpr =
lappend(nullable_partexpr,
c);
2018 elog(
ERROR,
"unrecognized join type: %d", (
int) jointype);
2041 nappinfos, appinfos);
AppendRelInfo ** find_appinfos_by_relids(PlannerInfo *root, Relids relids, int *nappinfos)
Node * adjust_appendrel_attrs(PlannerInfo *root, Node *node, int nappinfos, AppendRelInfo **appinfos)
uint32 bitmap_hash(const void *key, Size keysize)
bool bms_equal(const Bitmapset *a, const Bitmapset *b)
bool bms_is_subset(const Bitmapset *a, const Bitmapset *b)
int bms_num_members(const Bitmapset *a)
Bitmapset * bms_make_singleton(int x)
Bitmapset * bms_add_member(Bitmapset *a, int x)
Bitmapset * bms_union(const Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_del_members(Bitmapset *a, const Bitmapset *b)
bool bms_is_empty(const Bitmapset *a)
int bitmap_match(const void *key1, const void *key2, Size keysize)
bool bms_overlap(const Bitmapset *a, const Bitmapset *b)
Bitmapset * bms_copy(const Bitmapset *a)
bool bms_nonempty_difference(const Bitmapset *a, const Bitmapset *b)
#define MemSet(start, val, len)
#define OidIsValid(objectId)
bool is_parallel_safe(PlannerInfo *root, Node *node)
double get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel, List *param_clauses)
double get_parameterized_joinrel_size(PlannerInfo *root, RelOptInfo *rel, Path *outer_path, Path *inner_path, SpecialJoinInfo *sjinfo, List *restrict_clauses)
void set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel, RelOptInfo *outer_rel, RelOptInfo *inner_rel, SpecialJoinInfo *sjinfo, List *restrictlist)
bool enable_partitionwise_join
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
bool equal(const void *a, const void *b)
List * generate_join_implied_equalities_for_ecs(PlannerInfo *root, List *eclasses, Relids join_relids, Relids outer_relids, RelOptInfo *inner_rel)
List * generate_join_implied_equalities(PlannerInfo *root, Relids join_relids, Relids outer_relids, RelOptInfo *inner_rel)
void add_child_join_rel_equivalences(PlannerInfo *root, int nappinfos, AppendRelInfo **appinfos, RelOptInfo *parent_joinrel, RelOptInfo *child_joinrel)
bool has_relevant_eclass_joinclause(PlannerInfo *root, RelOptInfo *rel1)
bool apply_child_basequals(PlannerInfo *root, RelOptInfo *parentrel, RelOptInfo *childrel, RangeTblEntry *childRTE, AppendRelInfo *appinfo)
void mark_dummy_rel(RelOptInfo *rel)
Assert(fmt[strlen(fmt) - 1] !='\n')
List * lappend(List *list, void *datum)
List * list_copy(const List *oldlist)
bool list_member_oid(const List *list, Oid datum)
List * list_concat(List *list1, const List *list2)
List * list_append_unique_ptr(List *list, void *datum)
List * list_concat_copy(const List *list1, const List *list2)
bool op_in_opfamily(Oid opno, Oid opfamily)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
void * repalloc(void *pointer, Size size)
Oid exprType(const Node *expr)
Oid exprCollation(const Node *expr)
#define IsA(nodeptr, _type_)
#define IS_OUTER_JOIN(jointype)
#define castNode(_type_, nodeptr)
#define PARTITION_STRATEGY_HASH
bool has_useful_pathkeys(PlannerInfo *root, RelOptInfo *rel)
#define RINFO_IS_PUSHED_DOWN(rinfo, joinrelids)
#define IS_PARTITIONED_REL(rel)
#define PATH_REQ_OUTER(path)
@ RELOPT_OTHER_MEMBER_REL
#define IS_OTHER_REL(rel)
#define PARTITION_MAX_KEYS
#define lfirst_node(type, lc)
static int list_length(const List *l)
static void * list_nth(const List *list, int n)
#define list_make2(x1, x2)
void add_placeholders_to_joinrel(PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
void get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent, RelOptInfo *rel)
void setup_simple_rel_arrays(PlannerInfo *root)
static void set_joinrel_partition_key_exprs(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinType jointype)
ParamPathInfo * get_baserel_parampathinfo(PlannerInfo *root, RelOptInfo *baserel, Relids required_outer)
static List * subbuild_joinrel_restrictlist(RelOptInfo *joinrel, List *joininfo_list, List *new_restrictlist)
Relids min_join_parameterization(PlannerInfo *root, Relids joinrelids, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
static void build_join_rel_hash(PlannerInfo *root)
RelOptInfo * find_base_rel(PlannerInfo *root, int relid)
ParamPathInfo * get_appendrel_parampathinfo(RelOptInfo *appendrel, Relids required_outer)
RelOptInfo * build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent)
static List * build_joinrel_restrictlist(PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
Relids find_childrel_parents(PlannerInfo *root, RelOptInfo *rel)
void expand_planner_arrays(PlannerInfo *root, int add_size)
RelOptInfo * find_join_rel(PlannerInfo *root, Relids relids)
ParamPathInfo * get_joinrel_parampathinfo(PlannerInfo *root, RelOptInfo *joinrel, Path *outer_path, Path *inner_path, SpecialJoinInfo *sjinfo, Relids required_outer, List **restrict_clauses)
static void build_child_join_reltarget(PlannerInfo *root, RelOptInfo *parentrel, RelOptInfo *childrel, int nappinfos, AppendRelInfo **appinfos)
static void build_joinrel_tlist(PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *input_rel)
static int match_expr_to_partition_keys(Expr *expr, RelOptInfo *rel, bool strict_op)
static bool have_partkey_equi_join(RelOptInfo *joinrel, RelOptInfo *rel1, RelOptInfo *rel2, JoinType jointype, List *restrictlist)
RelOptInfo * build_join_rel(PlannerInfo *root, Relids joinrelids, RelOptInfo *outer_rel, RelOptInfo *inner_rel, SpecialJoinInfo *sjinfo, List **restrictlist_ptr)
static void set_foreign_rel_properties(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
struct JoinHashEntry JoinHashEntry
static void build_joinrel_joinlist(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
static void build_joinrel_partition_info(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel, List *restrictlist, JoinType jointype)
ParamPathInfo * find_param_path_info(RelOptInfo *rel, Relids required_outer)
RelOptInfo * fetch_upper_rel(PlannerInfo *root, UpperRelationKind kind, Relids relids)
static void add_join_rel(PlannerInfo *root, RelOptInfo *joinrel)
static List * subbuild_joinrel_joinlist(RelOptInfo *joinrel, List *joininfo_list, List *new_joininfo)
RelOptInfo * build_child_join_rel(PlannerInfo *root, RelOptInfo *outer_rel, RelOptInfo *inner_rel, RelOptInfo *parent_joinrel, List *restrictlist, SpecialJoinInfo *sjinfo, JoinType jointype)
bool join_clause_is_movable_into(RestrictInfo *rinfo, Relids currentrelids, Relids current_and_outer)
Size add_size(Size s1, Size s2)
ParamPathInfo * param_info
struct HTAB * join_rel_hash
int simple_rel_array_size
struct AppendRelInfo ** append_rel_array
List * upper_rels[UPPERREL_FINAL+1]
struct RelOptInfo ** simple_rel_array
RangeTblEntry ** simple_rte_array
Selectivity tuple_fraction
bool consider_param_startup
struct PathTarget * reltarget
struct FdwRoutine * fdwroutine
struct PartitionBoundInfoData * boundinfo
PartitionScheme part_scheme
List * cheapest_parameterized_paths
struct Path * cheapest_unique_path
Relids lateral_referencers
struct Path * cheapest_startup_path
QualCost baserestrictcost
struct Path * cheapest_total_path
List * non_unique_for_rels
Bitmapset * eclass_indexes
struct RelOptInfo ** part_rels
Relids direct_lateral_relids
List ** nullable_partexprs
bool consider_partitionwise_join
Index baserestrict_min_security
EquivalenceClass * left_ec
EquivalenceClass * right_ec
PathTarget * create_empty_pathtarget(void)