69#define CP_EXACT_TLIST 0x0001
70#define CP_SMALL_TLIST 0x0002
71#define CP_LABEL_TLIST 0x0004
72#define CP_IGNORE_TLIST 0x0008
178 double limit_tuples);
180 List *pathkeys,
double limit_tuples);
186 List *indexorderby,
List *indexorderbyorig,
187 List *indexorderbyops,
197 List *indexqualorig);
201 List *bitmapqualorig,
218 Index scanrelid,
int ctePlanId,
int cteParam);
220 Index scanrelid,
char *enrname);
222 Index scanrelid,
int wtParam);
240 List *hashoperators,
List *hashcollations,
262 bool skip_mark_restore);
267 int numCols,
int nPresortedCols,
282 List *pathkeys,
Relids relids,
int nPresortedCols);
288 Oid *collations,
List *param_exprs,
289 bool singlerow,
bool binary_mode,
293 double est_hit_ratio);
297 List *runCondition,
List *qual,
bool topWindow,
303 List *pathkeys,
int numCols,
306 int nworkers,
int rescan_param,
bool single_copy,
Plan *subplan);
319 List *resultRelations,
320 List *updateColnosLists,
321 List *withCheckOptionLists,
List *returningLists,
323 List *mergeActionLists,
List *mergeJoinConditions,
379 if (
root->curOuterParams !=
NIL)
380 elog(
ERROR,
"failed to assign all NestLoopParams to plan nodes");
543 elog(
ERROR,
"unrecognized node type: %d",
799 elog(
ERROR,
"unrecognized node type: %d",
830 foreach(v, path->pathtarget->exprs)
841 if (path->param_info)
910 path->pathtarget->exprs ==
NIL)
928 foreach(
lc,
root->placeholder_list)
948 if (!indexinfo->canreturn[
i])
967 foreach(
lc, path->pathtarget->exprs)
971 if (path->pathtarget->sortgrouprefs[
i])
973 if (expr &&
IsA(expr,
Var))
975 int attno = ((
Var *) expr)->varattno;
1003 if (!
root->hasPseudoConstantQuals)
1070 return &gplan->
plan;
1099 elog(
ERROR,
"unrecognized node type: %d",
1165 FdwRoutine *fdwroutine = path->parent->fdwroutine;
1201 plan->async_capable =
true;
1223 int nasyncplans = 0;
1268 plan->plan.targetlist = tlist;
1273 plan->child_append_relid_sets =
best_path->child_append_relid_sets;
1275 if (pathkeys !=
NIL)
1313 if (pathkeys !=
NIL)
1347 elog(
ERROR,
"Append child's targetlist doesn't match Append");
1369 sortColIdx, sortOperators,
1380 sortColIdx, sortOperators,
1398 subplans =
lappend(subplans, subplan);
1402 plan->part_prune_index = -1;
1432 plan->appendplans = subplans;
1433 plan->nasyncplans = nasyncplans;
1447 plan->plan.parallel_safe);
1481 plan->targetlist = tlist;
1500 &node->sortOperators,
1543 if (
memcmp(sortColIdx, node->sortColIdx,
1545 elog(
ERROR,
"MergeAppend child's targetlist doesn't match MergeAppend");
1567 sortColIdx, sortOperators,
1578 sortColIdx, sortOperators,
1588 subplans =
lappend(subplans, subplan);
1738 operators =
palloc(nkeys *
sizeof(
Oid));
1739 collations =
palloc(nkeys *
sizeof(
Oid));
1747 operators[
i] = opno;
1797 root->glob->parallelModeNeeded =
true;
1821 gm_plan->plan.targetlist = tlist;
1849 gm_plan->plan.lefttree = subplan;
1852 root->glob->parallelModeNeeded =
true;
1980 plan->parallel_safe = parallel_safe;
2220 foreach(
lc, groupClause)
2272 foreach(
lc,
root->processed_groupClause)
2283 foreach(
lc,
root->processed_groupClause)
2433 plan->disabled_nodes =
mminfo->path->disabled_nodes;
2434 plan->startup_cost =
mminfo->path->startup_cost;
2436 plan->plan_rows = 1;
2437 plan->plan_width =
mminfo->path->pathtarget->width;
2438 plan->parallel_aware =
false;
2439 plan->parallel_safe =
mminfo->path->parallel_safe;
2724 foreach(l,
parse->sortClause)
2924 if (rinfo->pseudoconstant)
2956 indexorderbys = (
List *)
2988 elog(
ERROR,
"missing operator %d(%u,%u) in opfamily %u",
2990 indexorderbyops =
lappend_oid(indexorderbyops, sortop);
3007 indextle->resjunk = !indexinfo->canreturn[
i];
3053 List *bitmapqualorig;
3066 &bitmapqualorig, &indexquals,
3104 if (rinfo->pseudoconstant)
3139 bitmapqualorig = (
List *)
3197 foreach(l,
apath->bitmapquals)
3207 subplans =
lappend(subplans, subplan);
3214 plan->startup_cost =
apath->path.startup_cost;
3215 plan->total_cost =
apath->path.total_cost;
3218 plan->plan_width = 0;
3219 plan->parallel_aware =
false;
3220 plan->parallel_safe =
apath->path.parallel_safe;
3244 foreach(l,
opath->bitmapquals)
3254 subplans =
lappend(subplans, subplan);
3278 plan->startup_cost =
opath->path.startup_cost;
3279 plan->total_cost =
opath->path.total_cost;
3282 plan->plan_width = 0;
3283 plan->parallel_aware =
false;
3284 plan->parallel_safe =
opath->path.parallel_safe;
3325 plan->startup_cost = 0.0;
3326 plan->total_cost =
ipath->indextotalcost;
3329 plan->plan_width = 0;
3330 plan->parallel_aware =
false;
3331 plan->parallel_safe =
ipath->path.parallel_safe;
3336 foreach(l,
ipath->indexclauses)
3341 Assert(!rinfo->pseudoconstant);
3345 if (rinfo->parent_ec)
3349 foreach(l,
ipath->indexinfo->indpred)
3423 if (rinfo->pseudoconstant)
3505 if (rinfo->pseudoconstant)
3524 tidrangequals = (
List *)
3660 tablefunc =
rte->tablefunc;
3703 values_lists =
rte->values_lists;
3717 values_lists = (
List *)
3757 levelsup =
rte->ctelevelsup;
3759 while (levelsup-- > 0)
3763 elog(
ERROR,
"bad levelsup for CTE \"%s\"",
rte->ctename);
3781 elog(
ERROR,
"could not find CTE \"%s\"",
rte->ctename);
3783 elog(
ERROR,
"could not find plan for CTE \"%s\"",
rte->ctename);
3786 elog(
ERROR,
"no plan was made for CTE \"%s\"",
rte->ctename);
3794 elog(
ERROR,
"could not find plan for CTE \"%s\"",
rte->ctename);
3926 levelsup =
rte->ctelevelsup;
3928 elog(
ERROR,
"bad levelsup for CTE \"%s\"",
rte->ctename);
3931 while (levelsup-- > 0)
3935 elog(
ERROR,
"bad levelsup for CTE \"%s\"",
rte->ctename);
3938 elog(
ERROR,
"could not find param ID for CTE \"%s\"",
rte->ctename);
4040 root->outer_join_rels);
4048 root->glob->dependsOnRole =
true;
4219 best_path->jpath.outerjoinpath->parent);
4231 outerrelids =
best_path->jpath.outerjoinpath->parent->relids;
4261 joinclauses = (
List *)
4270 best_path->jpath.innerjoinpath->parent->relids));
4293 foreach(
lc, nestParams)
4423 joinclauses = (
List *)
4435 best_path->jpath.outerjoinpath->parent->relids);
4568 if (rinfo->outer_is_left)
4600 elog(
ERROR,
"outer pathkeys do not match mergeclauses");
4605 elog(
ERROR,
"outer pathkeys do not match mergeclauses");
4649 elog(
ERROR,
"inner pathkeys do not match mergeclauses");
4668 elog(
ERROR,
"left and right pathkeys do not match in mergejoin");
4672 elog(
ERROR,
"left and right pathkeys do not match in mergejoin");
4731 bool skewInherit =
false;
4779 joinclauses = (
List *)
4790 best_path->jpath.outerjoinpath->parent->relids);
4817 skewTable =
rte->relid;
4819 skewInherit =
rte->inh;
4832 foreach(
lc, hashclauses)
4863 if (
best_path->jpath.path.parallel_aware)
4872 best_path->jpath.innerjoinpath->parent->relids));
4942 root->curOuterRels))
5007 int indexcol =
iclause->indexcol;
5118 elog(
ERROR,
"unsupported indexqual type: %d",
5155 if (
index->indexkeys[indexcol] != 0)
5159 ((
Var *) node)->varno ==
index->rel->relid &&
5160 ((
Var *) node)->varattno ==
index->indexkeys[indexcol])
5164 result->varattno = indexcol + 1;
5168 elog(
ERROR,
"index key does not match expected index column");
5173 for (pos = 0; pos <
index->ncolumns; pos++)
5175 if (
index->indexkeys[pos] == 0)
5178 elog(
ERROR,
"too few entries in indexprs list");
5179 if (pos == indexcol)
5195 elog(
ERROR,
"index key does not match expected index column");
5202 elog(
ERROR,
"index key does not match expected index column");
5238 temp->opresulttype = clause->opresulttype;
5239 temp->opretset = clause->opretset;
5240 temp->opcollid = clause->opcollid;
5241 temp->inputcollid = clause->inputcollid;
5299 Index security_level;
5317 foreach(
lc, clauses)
5323 items[
i].clause = clause;
5340 items[
i].security_level = 0;
5345 items[
i].security_level = 0;
5360 for (
j =
i;
j > 0;
j--)
5364 if (newitem.security_level >
olditem->security_level ||
5365 (newitem.security_level ==
olditem->security_level &&
5366 newitem.cost >=
olditem->cost))
5392 dest->plan_rows = src->
rows;
5393 dest->plan_width = src->pathtarget->width;
5411 dest->parallel_aware =
false;
5434 plan->plan.disabled_nodes,
5445 plan->plan.parallel_aware =
false;
5455 List *pathkeys,
double limit_tuples)
5463 plan->nPresortedCols,
5464 plan->sort.plan.disabled_nodes,
5476 plan->sort.plan.parallel_aware =
false;
5557 List *indexqualorig,
5559 List *indexorderbyorig,
5560 List *indexorderbyops,
5615 List *indexqualorig)
5636 List *bitmapqualorig,
5644 plan->lefttree = lefttree;
5675 List *tidrangequals)
5715 bool funcordinality)
5835 List *fdw_scan_tlist,
5836 List *fdw_recheck_quals,
5845 plan->lefttree = outer_plan;
5881 plan->targetlist = tlist;
5883 plan->lefttree = lefttree;
5904 foreach(
slitem, distinctList)
5969 plan->targetlist = tlist;
5971 plan->lefttree = lefttree;
5987 List *hashoperators,
5988 List *hashcollations,
5999 plan->targetlist = tlist;
6001 plan->lefttree = lefttree;
6027 plan->lefttree = lefttree;
6052 bool skip_mark_restore)
6057 plan->targetlist = tlist;
6059 plan->lefttree = lefttree;
6095 plan->lefttree = lefttree;
6098 node->sortColIdx = sortColIdx;
6099 node->sortOperators = sortOperators;
6100 node->collations = collations;
6125 plan->lefttree = lefttree;
6129 node->
sort.sortColIdx = sortColIdx;
6130 node->
sort.sortOperators = sortOperators;
6131 node->
sort.collations = collations;
6208 foreach(
i, pathkeys)
6226 elog(
ERROR,
"volatile EquivalenceClass has no sortref");
6292 elog(
ERROR,
"could not find pathkey item to sort");
6330 elog(
ERROR,
"missing operator %d(%u,%u) in opfamily %u",
6382 sortColIdx, sortOperators,
6397 Relids relids,
int nPresortedCols)
6418 sortColIdx, sortOperators,
6461 sortColIdx, sortOperators,
6505 elog(
ERROR,
"could not retrieve tle for sort-from-groupcols");
6515 sortColIdx, sortOperators,
6527 plan->lefttree = lefttree;
6579 matplan->parallel_aware =
false;
6587 List *param_exprs,
bool singlerow,
bool binary_mode,
6590 double est_hit_ratio)
6597 plan->lefttree = lefttree;
6601 node->hashOperators = hashoperators;
6602 node->collations = collations;
6620 Size transitionSpace,
Plan *lefttree)
6635 node->
chain = chain;
6638 plan->targetlist = tlist;
6639 plan->lefttree = lefttree;
6649 List *runCondition,
List *qual,
bool topWindow,
Plan *lefttree)
6677 plan->targetlist = tlist;
6678 plan->lefttree = lefttree;
6703 plan->targetlist = tlist;
6704 plan->lefttree = lefttree;
6730 plan->lefttree = lefttree;
6743 foreach(
lc, pathkeys)
6754 if (keyno >= numCols)
6765 elog(
ERROR,
"volatile EquivalenceClass has no sortref");
6778 foreach(
j,
plan->targetlist)
6793 elog(
ERROR,
"could not find pathkey item to sort");
6804 elog(
ERROR,
"missing operator %d(%u,%u) in opfamily %u",
6836 plan->lefttree = subplan;
6867 plan->targetlist = tlist;
6869 plan->lefttree = lefttree;
6881 foreach(
slitem, groupList)
6921 plan->lefttree = lefttree;
6944 plan->lefttree = lefttree;
6965 Node *resconstantqual,
6973 plan->targetlist = tlist;
6975 plan->lefttree = subplan;
6996 Node *resconstantqual,
7027 plan->lefttree = subplan;
7041 List *resultRelations,
7042 List *updateColnosLists,
7043 List *withCheckOptionLists,
List *returningLists,
7045 List *mergeActionLists,
List *mergeJoinConditions,
7061 updateColnosLists ==
NIL));
7136 foreach(
lc, resultRelations)
7151 root->simple_rel_array[rti] !=
NULL)
7155 fdwroutine = resultRel->fdwroutine;
7171 errmsg(
"access to non-system foreign table is restricted")));
7193 errmsg(
"cannot execute MERGE on relation \"%s\"",
7207 if (fdwroutine !=
NULL &&
7212 withCheckOptionLists ==
NIL &&
7224 root->parse->returningList);
7245 fdwroutine !=
NULL &&
Datum sort(PG_FUNCTION_ARGS)
#define InvalidAttrNumber
Bitmapset * bms_difference(const Bitmapset *a, const Bitmapset *b)
bool bms_is_subset(const Bitmapset *a, const Bitmapset *b)
void bms_free(Bitmapset *a)
bool bms_is_member(int x, const Bitmapset *a)
Bitmapset * bms_add_member(Bitmapset *a, int x)
Bitmapset * bms_union(const Bitmapset *a, const Bitmapset *b)
bool bms_nonempty_difference(const Bitmapset *a, const Bitmapset *b)
#define PG_USED_FOR_ASSERTS_ONLY
#define Assert(condition)
#define OidIsValid(objectId)
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
bool contain_mutable_functions(Node *clause)
bool is_parallel_safe(PlannerInfo *root, Node *node)
Bitmapset * pull_paramids(Expr *expr)
void CommuteOpExpr(OpExpr *clause)
void cost_material(Path *path, bool enabled, int input_disabled_nodes, Cost input_startup_cost, Cost input_total_cost, double tuples, int width)
void cost_sort(Path *path, PlannerInfo *root, List *pathkeys, int input_disabled_nodes, Cost input_cost, double tuples, int width, Cost comparison_cost, int sort_mem, double limit_tuples)
void cost_qual_eval_node(QualCost *cost, Node *qual, PlannerInfo *root)
void cost_incremental_sort(Path *path, PlannerInfo *root, List *pathkeys, int presorted_keys, int input_disabled_nodes, Cost input_startup_cost, Cost input_total_cost, double input_tuples, int width, Cost comparison_cost, int sort_mem, double limit_tuples)
double clamp_row_est(double nrows)
bool enable_partition_pruning
bool enable_incremental_sort
static Plan * create_join_plan(PlannerInfo *root, JoinPath *best_path)
static bool use_physical_tlist(PlannerInfo *root, Path *path, int flags)
static SeqScan * create_seqscan_plan(PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses)
static WorkTableScan * make_worktablescan(List *qptlist, List *qpqual, Index scanrelid, int wtParam)
static Plan * create_merge_append_plan(PlannerInfo *root, MergeAppendPath *best_path, int flags)
static List * order_qual_clauses(PlannerInfo *root, List *clauses)
static GatherMerge * create_gather_merge_plan(PlannerInfo *root, GatherMergePath *best_path)
static ValuesScan * create_valuesscan_plan(PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses)
static void copy_generic_path_info(Plan *dest, Path *src)
static WindowAgg * make_windowagg(List *tlist, WindowClause *wc, int partNumCols, AttrNumber *partColIdx, Oid *partOperators, Oid *partCollations, int ordNumCols, AttrNumber *ordColIdx, Oid *ordOperators, Oid *ordCollations, List *runCondition, List *qual, bool topWindow, Plan *lefttree)
Sort * make_sort_from_sortclauses(List *sortcls, Plan *lefttree)
static BitmapOr * make_bitmap_or(List *bitmapplans)
static HashJoin * create_hashjoin_plan(PlannerInfo *root, HashPath *best_path)
static SeqScan * make_seqscan(List *qptlist, List *qpqual, Index scanrelid)
static TableFuncScan * create_tablefuncscan_plan(PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses)
static CustomScan * create_customscan_plan(PlannerInfo *root, CustomPath *best_path, List *tlist, List *scan_clauses)
static Node * fix_indexqual_operand(Node *node, IndexOptInfo *index, int indexcol)
static void fix_indexqual_references(PlannerInfo *root, IndexPath *index_path, List **stripped_indexquals_p, List **fixed_indexquals_p)
static MergeJoin * make_mergejoin(List *tlist, List *joinclauses, List *otherclauses, List *mergeclauses, Oid *mergefamilies, Oid *mergecollations, bool *mergereversals, bool *mergenullsfirst, Plan *lefttree, Plan *righttree, JoinType jointype, Relids ojrelids, bool inner_unique, bool skip_mark_restore)
static List * fix_indexorderby_references(PlannerInfo *root, IndexPath *index_path)
static AttrNumber * remap_groupColIdx(PlannerInfo *root, List *groupClause)
static Plan * create_append_plan(PlannerInfo *root, AppendPath *best_path, int flags)
static void bitmap_subplan_mark_shared(Plan *plan)
static Unique * create_unique_plan(PlannerInfo *root, UniquePath *best_path, int flags)
static Result * make_one_row_result(List *tlist, Node *resconstantqual, RelOptInfo *rel)
static TidScan * make_tidscan(List *qptlist, List *qpqual, Index scanrelid, List *tidquals)
static MergeJoin * create_mergejoin_plan(PlannerInfo *root, MergePath *best_path)
static Plan * create_plan_recurse(PlannerInfo *root, Path *best_path, int flags)
static void label_sort_with_costsize(PlannerInfo *root, Sort *plan, double limit_tuples)
static ForeignScan * create_foreignscan_plan(PlannerInfo *root, ForeignPath *best_path, List *tlist, List *scan_clauses)
static BitmapHeapScan * create_bitmap_scan_plan(PlannerInfo *root, BitmapHeapPath *best_path, List *tlist, List *scan_clauses)
static IncrementalSort * make_incrementalsort(Plan *lefttree, int numCols, int nPresortedCols, AttrNumber *sortColIdx, Oid *sortOperators, Oid *collations, bool *nullsFirst)
static Result * create_group_result_plan(PlannerInfo *root, GroupResultPath *best_path)
static Limit * create_limit_plan(PlannerInfo *root, LimitPath *best_path, int flags)
static NestLoop * make_nestloop(List *tlist, List *joinclauses, List *otherclauses, List *nestParams, Plan *lefttree, Plan *righttree, JoinType jointype, Relids ojrelids, bool inner_unique)
static Unique * make_unique_from_pathkeys(Plan *lefttree, List *pathkeys, int numCols, Relids relids)
static Agg * create_agg_plan(PlannerInfo *root, AggPath *best_path)
bool is_projection_capable_path(Path *path)
static CteScan * make_ctescan(List *qptlist, List *qpqual, Index scanrelid, int ctePlanId, int cteParam)
static TidScan * create_tidscan_plan(PlannerInfo *root, TidPath *best_path, List *tlist, List *scan_clauses)
static TidRangeScan * make_tidrangescan(List *qptlist, List *qpqual, Index scanrelid, List *tidrangequals)
static Plan * create_bitmap_subplan(PlannerInfo *root, Path *bitmapqual, List **qual, List **indexqual, List **indexECs)
static RecursiveUnion * make_recursive_union(List *tlist, Plan *lefttree, Plan *righttree, int wtParam, List *distinctList, Cardinality numGroups)
static Node * fix_indexqual_clause(PlannerInfo *root, IndexOptInfo *index, int indexcol, Node *clause, List *indexcolnos)
static WorkTableScan * create_worktablescan_plan(PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses)
static Plan * create_gating_plan(PlannerInfo *root, Path *path, Plan *plan, List *gating_quals)
static Memoize * make_memoize(Plan *lefttree, Oid *hashoperators, Oid *collations, List *param_exprs, bool singlerow, bool binary_mode, uint32 est_entries, Bitmapset *keyparamids, Cardinality est_calls, Cardinality est_unique_keys, double est_hit_ratio)
static FunctionScan * create_functionscan_plan(PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses)
static Result * create_resultscan_plan(PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses)
static BitmapHeapScan * make_bitmap_heapscan(List *qptlist, List *qpqual, Plan *lefttree, List *bitmapqualorig, Index scanrelid)
static Node * replace_nestloop_params_mutator(Node *node, PlannerInfo *root)
static SetOp * create_setop_plan(PlannerInfo *root, SetOpPath *best_path, int flags)
bool is_projection_capable_plan(Plan *plan)
static CteScan * create_ctescan_plan(PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses)
static Sort * create_sort_plan(PlannerInfo *root, SortPath *best_path, int flags)
static ProjectSet * make_project_set(List *tlist, Plan *subplan)
static Sort * make_sort_from_pathkeys(Plan *lefttree, List *pathkeys, Relids relids)
static Gather * make_gather(List *qptlist, List *qpqual, int nworkers, int rescan_param, bool single_copy, Plan *subplan)
static Gather * create_gather_plan(PlannerInfo *root, GatherPath *best_path)
static Sort * make_sort(Plan *lefttree, int numCols, AttrNumber *sortColIdx, Oid *sortOperators, Oid *collations, bool *nullsFirst)
Limit * make_limit(Plan *lefttree, Node *limitOffset, Node *limitCount, LimitOption limitOption, int uniqNumCols, AttrNumber *uniqColIdx, Oid *uniqOperators, Oid *uniqCollations)
static ProjectSet * create_project_set_plan(PlannerInfo *root, ProjectSetPath *best_path)
static void label_incrementalsort_with_costsize(PlannerInfo *root, IncrementalSort *plan, List *pathkeys, double limit_tuples)
static SetOp * make_setop(SetOpCmd cmd, SetOpStrategy strategy, List *tlist, Plan *lefttree, Plan *righttree, List *groupList, Cardinality numGroups)
ForeignScan * make_foreignscan(List *qptlist, List *qpqual, Index scanrelid, List *fdw_exprs, List *fdw_private, List *fdw_scan_tlist, List *fdw_recheck_quals, Plan *outer_plan)
static Group * create_group_plan(PlannerInfo *root, GroupPath *best_path)
static ModifyTable * create_modifytable_plan(PlannerInfo *root, ModifyTablePath *best_path)
static Result * create_minmaxagg_plan(PlannerInfo *root, MinMaxAggPath *best_path)
static LockRows * create_lockrows_plan(PlannerInfo *root, LockRowsPath *best_path, int flags)
static Material * create_material_plan(PlannerInfo *root, MaterialPath *best_path, int flags)
static List * get_gating_quals(PlannerInfo *root, List *quals)
static HashJoin * make_hashjoin(List *tlist, List *joinclauses, List *otherclauses, List *hashclauses, List *hashoperators, List *hashcollations, List *hashkeys, Plan *lefttree, Plan *righttree, JoinType jointype, Relids ojrelids, bool inner_unique)
static Plan * create_scan_plan(PlannerInfo *root, Path *best_path, int flags)
static Group * make_group(List *tlist, List *qual, int numGroupCols, AttrNumber *grpColIdx, Oid *grpOperators, Oid *grpCollations, Plan *lefttree)
static LockRows * make_lockrows(Plan *lefttree, List *rowMarks, int epqParam)
static IncrementalSort * create_incrementalsort_plan(PlannerInfo *root, IncrementalSortPath *best_path, int flags)
static NamedTuplestoreScan * create_namedtuplestorescan_plan(PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses)
static Plan * create_projection_plan(PlannerInfo *root, ProjectionPath *best_path, int flags)
static IndexOnlyScan * make_indexonlyscan(List *qptlist, List *qpqual, Index scanrelid, Oid indexid, List *indexqual, List *recheckqual, List *indexorderby, List *indextlist, ScanDirection indexscandir)
static List * build_path_tlist(PlannerInfo *root, Path *path)
static IndexScan * make_indexscan(List *qptlist, List *qpqual, Index scanrelid, Oid indexid, List *indexqual, List *indexqualorig, List *indexorderby, List *indexorderbyorig, List *indexorderbyops, ScanDirection indexscandir)
static FunctionScan * make_functionscan(List *qptlist, List *qpqual, Index scanrelid, List *functions, bool funcordinality)
static TableFuncScan * make_tablefuncscan(List *qptlist, List *qpqual, Index scanrelid, TableFunc *tablefunc)
static SubqueryScan * create_subqueryscan_plan(PlannerInfo *root, SubqueryScanPath *best_path, List *tlist, List *scan_clauses)
static Plan * inject_projection_plan(Plan *subplan, List *tlist, bool parallel_safe)
static TidRangeScan * create_tidrangescan_plan(PlannerInfo *root, TidRangePath *best_path, List *tlist, List *scan_clauses)
static List * get_switched_clauses(List *clauses, Relids outerrelids)
static void copy_plan_costsize(Plan *dest, Plan *src)
static ValuesScan * make_valuesscan(List *qptlist, List *qpqual, Index scanrelid, List *values_lists)
Plan * materialize_finished_plan(Plan *subplan)
static SampleScan * make_samplescan(List *qptlist, List *qpqual, Index scanrelid, TableSampleClause *tsc)
static NestLoop * create_nestloop_plan(PlannerInfo *root, NestPath *best_path)
static Memoize * create_memoize_plan(PlannerInfo *root, MemoizePath *best_path, int flags)
static Result * make_gating_result(List *tlist, Node *resconstantqual, Plan *subplan)
Agg * make_agg(List *tlist, List *qual, AggStrategy aggstrategy, AggSplit aggsplit, int numGroupCols, AttrNumber *grpColIdx, Oid *grpOperators, Oid *grpCollations, List *groupingSets, List *chain, Cardinality numGroups, Size transitionSpace, Plan *lefttree)
static NamedTuplestoreScan * make_namedtuplestorescan(List *qptlist, List *qpqual, Index scanrelid, char *enrname)
static bool mark_async_capable_plan(Plan *plan, Path *path)
static Material * make_material(Plan *lefttree)
Plan * change_plan_targetlist(Plan *subplan, List *tlist, bool tlist_parallel_safe)
static ModifyTable * make_modifytable(PlannerInfo *root, Plan *subplan, CmdType operation, bool canSetTag, Index nominalRelation, Index rootRelation, List *resultRelations, List *updateColnosLists, List *withCheckOptionLists, List *returningLists, List *rowMarks, OnConflictExpr *onconflict, List *mergeActionLists, List *mergeJoinConditions, ForPortionOfExpr *forPortionOf, int epqParam)
static BitmapIndexScan * make_bitmap_indexscan(Index scanrelid, Oid indexid, List *indexqual, List *indexqualorig)
static SubqueryScan * make_subqueryscan(List *qptlist, List *qpqual, Index scanrelid, Plan *subplan)
static Hash * make_hash(Plan *lefttree, List *hashkeys, Oid skewTable, AttrNumber skewColumn, bool skewInherit)
static WindowAgg * create_windowagg_plan(PlannerInfo *root, WindowAggPath *best_path)
static Node * replace_nestloop_params(PlannerInfo *root, Node *expr)
static BitmapAnd * make_bitmap_and(List *bitmapplans)
static Plan * create_groupingsets_plan(PlannerInfo *root, GroupingSetsPath *best_path)
static RecursiveUnion * create_recursiveunion_plan(PlannerInfo *root, RecursiveUnionPath *best_path)
static Sort * make_sort_from_groupcols(List *groupcls, AttrNumber *grpColIdx, Plan *lefttree)
static Scan * create_indexscan_plan(PlannerInfo *root, IndexPath *best_path, List *tlist, List *scan_clauses, bool indexonly)
static Plan * prepare_sort_from_pathkeys(Plan *lefttree, List *pathkeys, Relids relids, const AttrNumber *reqColIdx, bool adjust_tlist_in_place, int *p_numsortkeys, AttrNumber **p_sortColIdx, Oid **p_sortOperators, Oid **p_collations, bool **p_nullsFirst)
static IncrementalSort * make_incrementalsort_from_pathkeys(Plan *lefttree, List *pathkeys, Relids relids, int nPresortedCols)
static SampleScan * create_samplescan_plan(PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses)
Plan * create_plan(PlannerInfo *root, Path *best_path)
static DataChecksumsWorkerOperation operation
int errcode(int sqlerrcode)
#define ereport(elevel,...)
bool equal(const void *a, const void *b)
bool is_redundant_with_indexclauses(RestrictInfo *rinfo, List *indexclauses)
EquivalenceMember * find_ec_member_matching_expr(EquivalenceClass *ec, Expr *expr, Relids relids)
EquivalenceMember * find_computable_ec_member(PlannerInfo *root, EquivalenceClass *ec, List *exprs, Relids relids, bool require_parallel_safe)
bool is_redundant_derived_clause(RestrictInfo *rinfo, List *clauselist)
#define CUSTOMPATH_SUPPORT_PROJECTION
#define palloc_array(type, count)
#define palloc0_array(type, count)
FdwRoutine * GetFdwRoutineByRelId(Oid relid)
List * list_difference(const List *list1, const List *list2)
List * lappend(List *list, void *datum)
List * list_difference_ptr(const List *list1, const List *list2)
List * list_concat(List *list1, const List *list2)
List * list_concat_copy(const List *list1, const List *list2)
List * list_copy(const List *oldlist)
List * lappend_oid(List *list, Oid datum)
bool list_member_ptr(const List *list, const void *datum)
bool list_member(const List *list, const void *datum)
List * list_copy_head(const List *oldlist, int len)
List * list_concat_unique(List *list1, const List *list2)
char * get_rel_name(Oid relid)
Oid get_opfamily_member_for_cmptype(Oid opfamily, Oid lefttype, Oid righttype, CompareType cmptype)
Datum lca(PG_FUNCTION_ARGS)
Datum subpath(PG_FUNCTION_ARGS)
Expr * make_orclause(List *orclauses)
Expr * make_ands_explicit(List *andclauses)
Var * makeVar(int varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup)
Node * makeBoolConst(bool value, bool isnull)
TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk)
void * palloc0(Size size)
Oid exprType(const Node *expr)
Oid exprCollation(const Node *expr)
#define expression_tree_mutator(n, m, c)
static bool is_opclause(const void *clause)
#define IsA(nodeptr, _type_)
#define IS_OUTER_JOIN(jointype)
#define castNode(_type_, nodeptr)
void process_subquery_nestloop_params(PlannerInfo *root, List *subplan_params)
List * identify_current_nestloop_params(PlannerInfo *root, Relids leftrelids, Relids outerrelids)
Param * replace_nestloop_param_placeholdervar(PlannerInfo *root, PlaceHolderVar *phv)
int assign_special_exec_param(PlannerInfo *root)
Param * replace_nestloop_param_var(PlannerInfo *root, Var *var)
TargetEntry * get_tle_by_resno(List *tlist, AttrNumber resno)
int make_partition_pruneinfo(PlannerInfo *root, RelOptInfo *parentrel, List *subpaths, List *prunequal)
bool pathkeys_count_contained_in(List *keys1, List *keys2, int *n_common)
bool pathkeys_contained_in(List *keys1, List *keys2)
Path * reparameterize_path_by_child(PlannerInfo *root, Path *path, RelOptInfo *child_rel)
#define IS_DUMMY_APPEND(p)
#define PATH_REQ_OUTER(path)
#define planner_rt_fetch(rti, root)
#define IS_OTHER_REL(rel)
#define IS_UPPER_REL(rel)
int errdetail_relkind_not_supported(char relkind)
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define forboth(cell1, list1, cell2, list2)
#define for_each_from(cell, lst, N)
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
static int list_nth_int(const List *list, int n)
PlaceHolderInfo * find_placeholder_info(PlannerInfo *root, PlaceHolderVar *phv)
Node * strip_noop_phvs(Node *node)
bool has_stored_generated_columns(PlannerInfo *root, Index rti)
bool has_row_triggers(PlannerInfo *root, Index rti, CmdType event)
List * build_physical_tlist(PlannerInfo *root, RelOptInfo *rel)
bool has_transition_tables(PlannerInfo *root, Index rti, CmdType event)
List * infer_arbiter_indexes(PlannerInfo *root)
int restrict_nonsystem_relation_kind
bool predicate_implied_by(List *predicate_list, List *clause_list, bool weak)
List * extract_update_targetlist_colnos(List *tlist)
#define IS_SPECIAL_VARNO(varno)
static const struct fns functions
List * extract_actual_clauses(List *restrictinfo_list, bool pseudoconstant)
void extract_actual_join_clauses(List *restrictinfo_list, Relids joinrelids, List **joinquals, List **otherquals)
List * get_actual_clauses(List *restrictinfo_list)
bool trivial_subqueryscan(SubqueryScan *plan)
void check_stack_depth(void)
Bitmapset * custom_relids
const struct CustomScanMethods * methods
BeginDirectModify_function BeginDirectModify
PlanForeignModify_function PlanForeignModify
PlanDirectModify_function PlanDirectModify
IterateDirectModify_function IterateDirectModify
EndDirectModify_function EndDirectModify
IsForeignPathAsyncCapable_function IsForeignPathAsyncCapable
Bitmapset * fs_base_relids
ScanDirection indexorderdir
ScanDirection indexorderdir
Cardinality est_unique_keys
List * child_append_relid_sets
List * mergeJoinConditions
Bitmapset * fdwDirectModifyPlans
List * withCheckOptionLists
LockClauseStrength onConflictLockStrength
OnConflictAction onConflictAction
LockClauseStrength lockStrength
struct PathTarget * reltarget
struct TableSampleClause * tablesample
SubqueryScanStatus scanstatus
void SS_attach_initplans(PlannerInfo *root, Plan *plan)
void SS_compute_initplan_cost(List *init_plans, Cost *initplan_cost_p, bool *unsafe_initplans_p)
void SS_make_initplan_from_plan(PlannerInfo *root, PlannerInfo *subroot, Plan *plan, Param *prm)
#define FirstLowInvalidHeapAttributeNumber
#define RESTRICT_RELKIND_FOREIGN_TABLE
Oid * extract_grouping_ops(List *groupClause)
TargetEntry * tlist_member(Expr *node, List *targetlist)
bool tlist_same_exprs(List *tlist1, List *tlist2)
void apply_tlist_labeling(List *dest_tlist, List *src_tlist)
void apply_pathtarget_labeling_to_tlist(List *tlist, PathTarget *target)
AttrNumber * extract_grouping_cols(List *groupClause, List *tlist)
TargetEntry * get_sortgroupclause_tle(SortGroupClause *sgClause, List *targetList)
TargetEntry * get_sortgroupref_tle(Index sortref, List *targetList)
Oid * extract_grouping_collations(List *groupClause, List *tlist)
#define FirstNormalObjectId
void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos)
bool contain_vars_returning_old_or_new(Node *node)