PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <math.h>
#include "access/sysattr.h"
#include "catalog/pg_class.h"
#include "foreign/fdwapi.h"
#include "miscadmin.h"
#include "nodes/extensible.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/clauses.h"
#include "optimizer/cost.h"
#include "optimizer/optimizer.h"
#include "optimizer/paramassign.h"
#include "optimizer/pathnode.h"
#include "optimizer/paths.h"
#include "optimizer/placeholder.h"
#include "optimizer/plancat.h"
#include "optimizer/planmain.h"
#include "optimizer/prep.h"
#include "optimizer/restrictinfo.h"
#include "optimizer/subselect.h"
#include "optimizer/tlist.h"
#include "parser/parse_clause.h"
#include "parser/parsetree.h"
#include "partitioning/partprune.h"
#include "tcop/tcopprot.h"
#include "utils/lsyscache.h"
Go to the source code of this file.
Macros | |
#define | CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */ |
#define | CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */ |
#define | CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */ |
#define | CP_IGNORE_TLIST 0x0008 /* caller will replace tlist */ |
Functions | |
static Plan * | create_plan_recurse (PlannerInfo *root, Path *best_path, int flags) |
static Plan * | create_scan_plan (PlannerInfo *root, Path *best_path, int flags) |
static List * | build_path_tlist (PlannerInfo *root, Path *path) |
static bool | use_physical_tlist (PlannerInfo *root, Path *path, int flags) |
static List * | get_gating_quals (PlannerInfo *root, List *quals) |
static Plan * | create_gating_plan (PlannerInfo *root, Path *path, Plan *plan, List *gating_quals) |
static Plan * | create_join_plan (PlannerInfo *root, JoinPath *best_path) |
static bool | mark_async_capable_plan (Plan *plan, Path *path) |
static Plan * | create_append_plan (PlannerInfo *root, AppendPath *best_path, int flags) |
static Plan * | create_merge_append_plan (PlannerInfo *root, MergeAppendPath *best_path, int flags) |
static Result * | create_group_result_plan (PlannerInfo *root, GroupResultPath *best_path) |
static ProjectSet * | create_project_set_plan (PlannerInfo *root, ProjectSetPath *best_path) |
static Material * | create_material_plan (PlannerInfo *root, MaterialPath *best_path, int flags) |
static Memoize * | create_memoize_plan (PlannerInfo *root, MemoizePath *best_path, int flags) |
static Plan * | create_unique_plan (PlannerInfo *root, UniquePath *best_path, int flags) |
static Gather * | create_gather_plan (PlannerInfo *root, GatherPath *best_path) |
static Plan * | create_projection_plan (PlannerInfo *root, ProjectionPath *best_path, int flags) |
static Plan * | inject_projection_plan (Plan *subplan, List *tlist, bool parallel_safe) |
static Sort * | create_sort_plan (PlannerInfo *root, SortPath *best_path, int flags) |
static IncrementalSort * | create_incrementalsort_plan (PlannerInfo *root, IncrementalSortPath *best_path, int flags) |
static Group * | create_group_plan (PlannerInfo *root, GroupPath *best_path) |
static Unique * | create_upper_unique_plan (PlannerInfo *root, UpperUniquePath *best_path, int flags) |
static Agg * | create_agg_plan (PlannerInfo *root, AggPath *best_path) |
static Plan * | create_groupingsets_plan (PlannerInfo *root, GroupingSetsPath *best_path) |
static Result * | create_minmaxagg_plan (PlannerInfo *root, MinMaxAggPath *best_path) |
static WindowAgg * | create_windowagg_plan (PlannerInfo *root, WindowAggPath *best_path) |
static SetOp * | create_setop_plan (PlannerInfo *root, SetOpPath *best_path, int flags) |
static RecursiveUnion * | create_recursiveunion_plan (PlannerInfo *root, RecursiveUnionPath *best_path) |
static LockRows * | create_lockrows_plan (PlannerInfo *root, LockRowsPath *best_path, int flags) |
static ModifyTable * | create_modifytable_plan (PlannerInfo *root, ModifyTablePath *best_path) |
static Limit * | create_limit_plan (PlannerInfo *root, LimitPath *best_path, int flags) |
static SeqScan * | create_seqscan_plan (PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses) |
static SampleScan * | create_samplescan_plan (PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses) |
static Scan * | create_indexscan_plan (PlannerInfo *root, IndexPath *best_path, List *tlist, List *scan_clauses, bool indexonly) |
static BitmapHeapScan * | create_bitmap_scan_plan (PlannerInfo *root, BitmapHeapPath *best_path, List *tlist, List *scan_clauses) |
static Plan * | create_bitmap_subplan (PlannerInfo *root, Path *bitmapqual, List **qual, List **indexqual, List **indexECs) |
static void | bitmap_subplan_mark_shared (Plan *plan) |
static TidScan * | create_tidscan_plan (PlannerInfo *root, TidPath *best_path, List *tlist, List *scan_clauses) |
static TidRangeScan * | create_tidrangescan_plan (PlannerInfo *root, TidRangePath *best_path, List *tlist, List *scan_clauses) |
static SubqueryScan * | create_subqueryscan_plan (PlannerInfo *root, SubqueryScanPath *best_path, List *tlist, List *scan_clauses) |
static FunctionScan * | create_functionscan_plan (PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses) |
static ValuesScan * | create_valuesscan_plan (PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses) |
static TableFuncScan * | create_tablefuncscan_plan (PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses) |
static CteScan * | create_ctescan_plan (PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses) |
static NamedTuplestoreScan * | create_namedtuplestorescan_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 WorkTableScan * | create_worktablescan_plan (PlannerInfo *root, Path *best_path, List *tlist, List *scan_clauses) |
static ForeignScan * | create_foreignscan_plan (PlannerInfo *root, ForeignPath *best_path, List *tlist, List *scan_clauses) |
static CustomScan * | create_customscan_plan (PlannerInfo *root, CustomPath *best_path, List *tlist, List *scan_clauses) |
static NestLoop * | create_nestloop_plan (PlannerInfo *root, NestPath *best_path) |
static MergeJoin * | create_mergejoin_plan (PlannerInfo *root, MergePath *best_path) |
static HashJoin * | create_hashjoin_plan (PlannerInfo *root, HashPath *best_path) |
static Node * | replace_nestloop_params (PlannerInfo *root, Node *expr) |
static Node * | replace_nestloop_params_mutator (Node *node, PlannerInfo *root) |
static void | fix_indexqual_references (PlannerInfo *root, IndexPath *index_path, List **stripped_indexquals_p, List **fixed_indexquals_p) |
static List * | fix_indexorderby_references (PlannerInfo *root, IndexPath *index_path) |
static Node * | fix_indexqual_clause (PlannerInfo *root, IndexOptInfo *index, int indexcol, Node *clause, List *indexcolnos) |
static Node * | fix_indexqual_operand (Node *node, IndexOptInfo *index, int indexcol) |
static List * | get_switched_clauses (List *clauses, Relids outerrelids) |
static List * | order_qual_clauses (PlannerInfo *root, List *clauses) |
static void | copy_generic_path_info (Plan *dest, Path *src) |
static void | copy_plan_costsize (Plan *dest, Plan *src) |
static void | label_sort_with_costsize (PlannerInfo *root, Sort *plan, double limit_tuples) |
static void | label_incrementalsort_with_costsize (PlannerInfo *root, IncrementalSort *plan, List *pathkeys, double limit_tuples) |
static SeqScan * | make_seqscan (List *qptlist, List *qpqual, Index scanrelid) |
static SampleScan * | make_samplescan (List *qptlist, List *qpqual, Index scanrelid, TableSampleClause *tsc) |
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 IndexOnlyScan * | make_indexonlyscan (List *qptlist, List *qpqual, Index scanrelid, Oid indexid, List *indexqual, List *recheckqual, List *indexorderby, List *indextlist, ScanDirection indexscandir) |
static BitmapIndexScan * | make_bitmap_indexscan (Index scanrelid, Oid indexid, List *indexqual, List *indexqualorig) |
static BitmapHeapScan * | make_bitmap_heapscan (List *qptlist, List *qpqual, Plan *lefttree, List *bitmapqualorig, Index scanrelid) |
static TidScan * | make_tidscan (List *qptlist, List *qpqual, Index scanrelid, List *tidquals) |
static TidRangeScan * | make_tidrangescan (List *qptlist, List *qpqual, Index scanrelid, List *tidrangequals) |
static SubqueryScan * | make_subqueryscan (List *qptlist, List *qpqual, Index scanrelid, Plan *subplan) |
static FunctionScan * | make_functionscan (List *qptlist, List *qpqual, Index scanrelid, List *functions, bool funcordinality) |
static ValuesScan * | make_valuesscan (List *qptlist, List *qpqual, Index scanrelid, List *values_lists) |
static TableFuncScan * | make_tablefuncscan (List *qptlist, List *qpqual, Index scanrelid, TableFunc *tablefunc) |
static CteScan * | make_ctescan (List *qptlist, List *qpqual, Index scanrelid, int ctePlanId, int cteParam) |
static NamedTuplestoreScan * | make_namedtuplestorescan (List *qptlist, List *qpqual, Index scanrelid, char *enrname) |
static WorkTableScan * | make_worktablescan (List *qptlist, List *qpqual, Index scanrelid, int wtParam) |
static RecursiveUnion * | make_recursive_union (List *tlist, Plan *lefttree, Plan *righttree, int wtParam, List *distinctList, long numGroups) |
static BitmapAnd * | make_bitmap_and (List *bitmapplans) |
static BitmapOr * | make_bitmap_or (List *bitmapplans) |
static NestLoop * | make_nestloop (List *tlist, List *joinclauses, List *otherclauses, List *nestParams, Plan *lefttree, Plan *righttree, JoinType jointype, bool inner_unique) |
static HashJoin * | make_hashjoin (List *tlist, List *joinclauses, List *otherclauses, List *hashclauses, List *hashoperators, List *hashcollations, List *hashkeys, Plan *lefttree, Plan *righttree, JoinType jointype, bool inner_unique) |
static Hash * | make_hash (Plan *lefttree, List *hashkeys, Oid skewTable, AttrNumber skewColumn, bool skewInherit) |
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, bool inner_unique, bool skip_mark_restore) |
static Sort * | make_sort (Plan *lefttree, int numCols, AttrNumber *sortColIdx, Oid *sortOperators, Oid *collations, bool *nullsFirst) |
static IncrementalSort * | make_incrementalsort (Plan *lefttree, int numCols, int nPresortedCols, AttrNumber *sortColIdx, Oid *sortOperators, Oid *collations, bool *nullsFirst) |
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 Sort * | make_sort_from_pathkeys (Plan *lefttree, List *pathkeys, Relids relids) |
static IncrementalSort * | make_incrementalsort_from_pathkeys (Plan *lefttree, List *pathkeys, Relids relids, int nPresortedCols) |
static Sort * | make_sort_from_groupcols (List *groupcls, AttrNumber *grpColIdx, Plan *lefttree) |
static Material * | make_material (Plan *lefttree) |
static Memoize * | make_memoize (Plan *lefttree, Oid *hashoperators, Oid *collations, List *param_exprs, bool singlerow, bool binary_mode, uint32 est_entries, Bitmapset *keyparamids) |
static WindowAgg * | make_windowagg (List *tlist, Index winref, int partNumCols, AttrNumber *partColIdx, Oid *partOperators, Oid *partCollations, int ordNumCols, AttrNumber *ordColIdx, Oid *ordOperators, Oid *ordCollations, int frameOptions, Node *startOffset, Node *endOffset, Oid startInRangeFunc, Oid endInRangeFunc, Oid inRangeColl, bool inRangeAsc, bool inRangeNullsFirst, List *runCondition, List *qual, bool topWindow, Plan *lefttree) |
static Group * | make_group (List *tlist, List *qual, int numGroupCols, AttrNumber *grpColIdx, Oid *grpOperators, Oid *grpCollations, Plan *lefttree) |
static Unique * | make_unique_from_sortclauses (Plan *lefttree, List *distinctList) |
static Unique * | make_unique_from_pathkeys (Plan *lefttree, List *pathkeys, int numCols) |
static Gather * | make_gather (List *qptlist, List *qpqual, int nworkers, int rescan_param, bool single_copy, Plan *subplan) |
static SetOp * | make_setop (SetOpCmd cmd, SetOpStrategy strategy, Plan *lefttree, List *distinctList, AttrNumber flagColIdx, int firstFlag, long numGroups) |
static LockRows * | make_lockrows (Plan *lefttree, List *rowMarks, int epqParam) |
static Result * | make_result (List *tlist, Node *resconstantqual, Plan *subplan) |
static ProjectSet * | make_project_set (List *tlist, Plan *subplan) |
static ModifyTable * | make_modifytable (PlannerInfo *root, Plan *subplan, CmdType operation, bool canSetTag, Index nominalRelation, Index rootRelation, bool partColsUpdated, List *resultRelations, List *updateColnosLists, List *withCheckOptionLists, List *returningLists, List *rowMarks, OnConflictExpr *onconflict, List *mergeActionLists, List *mergeJoinConditions, int epqParam) |
static GatherMerge * | create_gather_merge_plan (PlannerInfo *root, GatherMergePath *best_path) |
Plan * | create_plan (PlannerInfo *root, Path *best_path) |
Plan * | change_plan_targetlist (Plan *subplan, List *tlist, bool tlist_parallel_safe) |
static AttrNumber * | remap_groupColIdx (PlannerInfo *root, List *groupClause) |
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) |
Sort * | make_sort_from_sortclauses (List *sortcls, Plan *lefttree) |
Plan * | materialize_finished_plan (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, double dNumGroups, Size transitionSpace, Plan *lefttree) |
Limit * | make_limit (Plan *lefttree, Node *limitOffset, Node *limitCount, LimitOption limitOption, int uniqNumCols, AttrNumber *uniqColIdx, Oid *uniqOperators, Oid *uniqCollations) |
bool | is_projection_capable_path (Path *path) |
bool | is_projection_capable_plan (Plan *plan) |
#define CP_EXACT_TLIST 0x0001 /* Plan must return specified tlist */ |
Definition at line 70 of file createplan.c.
#define CP_IGNORE_TLIST 0x0008 /* caller will replace tlist */ |
Definition at line 73 of file createplan.c.
#define CP_LABEL_TLIST 0x0004 /* tlist must contain sortgrouprefs */ |
Definition at line 72 of file createplan.c.
#define CP_SMALL_TLIST 0x0002 /* Prefer narrower tlists */ |
Definition at line 71 of file createplan.c.
|
static |
Definition at line 5552 of file createplan.c.
References elog, ERROR, IsA, linitial, nodeTag, and plan.
Referenced by create_bitmap_scan_plan().
|
static |
Definition at line 828 of file createplan.c.
References lappend(), lfirst, makeTargetEntry(), NIL, replace_nestloop_params(), TargetEntry::ressortgroupref, and root.
Referenced by create_agg_plan(), create_append_plan(), create_gather_merge_plan(), create_gather_plan(), create_gating_plan(), create_group_plan(), create_group_result_plan(), create_groupingsets_plan(), create_hashjoin_plan(), create_merge_append_plan(), create_mergejoin_plan(), create_minmaxagg_plan(), create_nestloop_plan(), create_project_set_plan(), create_projection_plan(), create_recursiveunion_plan(), create_scan_plan(), create_unique_plan(), and create_windowagg_plan().
Definition at line 2151 of file createplan.c.
References inject_projection_plan(), is_projection_capable_plan(), Plan::parallel_safe, Plan::targetlist, and tlist_same_exprs().
Referenced by create_unique_plan(), and postgresGetForeignPlan().
Definition at line 5453 of file createplan.c.
References generate_unaccent_rules::dest, Path::disabled_nodes, Path::parallel_aware, Path::parallel_safe, Path::rows, Path::startup_cost, and Path::total_cost.
Referenced by create_agg_plan(), create_append_plan(), create_bitmap_scan_plan(), create_ctescan_plan(), create_customscan_plan(), create_foreignscan_plan(), create_functionscan_plan(), create_gather_merge_plan(), create_gather_plan(), create_group_plan(), create_group_result_plan(), create_groupingsets_plan(), create_hashjoin_plan(), create_incrementalsort_plan(), create_indexscan_plan(), create_limit_plan(), create_lockrows_plan(), create_material_plan(), create_memoize_plan(), create_merge_append_plan(), create_mergejoin_plan(), create_minmaxagg_plan(), create_modifytable_plan(), create_namedtuplestorescan_plan(), create_nestloop_plan(), create_project_set_plan(), create_projection_plan(), create_recursiveunion_plan(), create_resultscan_plan(), create_samplescan_plan(), create_seqscan_plan(), create_setop_plan(), create_sort_plan(), create_subqueryscan_plan(), create_tablefuncscan_plan(), create_tidrangescan_plan(), create_tidscan_plan(), create_unique_plan(), create_upper_unique_plan(), create_valuesscan_plan(), create_windowagg_plan(), and create_worktablescan_plan().
Definition at line 5469 of file createplan.c.
References generate_unaccent_rules::dest, Plan::disabled_nodes, Plan::parallel_safe, Plan::plan_rows, Plan::plan_width, Plan::startup_cost, and Plan::total_cost.
Referenced by create_gating_plan(), create_hashjoin_plan(), create_mergejoin_plan(), and inject_projection_plan().
|
static |
Definition at line 2307 of file createplan.c.
References AggPath::aggsplit, AggPath::aggstrategy, build_path_tlist(), copy_generic_path_info(), CP_LABEL_TLIST, create_plan_recurse(), extract_grouping_collations(), extract_grouping_cols(), extract_grouping_ops(), AggPath::groupClause, list_length(), make_agg(), NIL, AggPath::numGroups, order_qual_clauses(), AggPath::path, plan, AggPath::qual, root, AggPath::subpath, Plan::targetlist, and AggPath::transitionSpace.
Referenced by create_plan_recurse().
|
static |
Definition at line 1219 of file createplan.c.
References Assert, Plan::async_capable, RelOptInfo::baserestrictinfo, build_path_tlist(), copy_generic_path_info(), CP_EXACT_TLIST, CP_SMALL_TLIST, create_plan_recurse(), elog, enable_async_append, enable_partition_pruning, ERROR, extract_actual_clauses(), AppendPath::first_partial_path, inject_projection_plan(), label_sort_with_costsize(), lappend(), lfirst, AppendPath::limit_tuples, list_concat(), list_copy_head(), list_length(), list_make1, make_partition_pruneinfo(), make_result(), make_sort(), makeBoolConst(), makeNode, mark_async_capable_plan(), NIL, Path::parallel_safe, AppendPath::path, Path::pathkeys, pathkeys_contained_in(), plan, prepare_sort_from_pathkeys(), RelOptInfo::relids, replace_nestloop_params(), root, sort(), subpath(), and AppendPath::subpaths.
Referenced by create_plan_recurse().
|
static |
Definition at line 3201 of file createplan.c.
References Assert, bitmap_subplan_mark_shared(), BitmapHeapPath::bitmapqual, RestrictInfo::clause, contain_mutable_functions(), copy_generic_path_info(), create_bitmap_subplan(), extract_actual_clauses(), if(), lappend(), lfirst_node, list_difference_ptr(), list_make1, list_member(), list_member_ptr(), make_bitmap_heapscan(), NIL, order_qual_clauses(), Path::parallel_aware, BitmapHeapPath::path, predicate_implied_by(), replace_nestloop_params(), root, RTE_RELATION, and BitmapHeapScan::scan.
Referenced by create_scan_plan().
|
static |
Definition at line 3331 of file createplan.c.
References Assert, BitmapAndPath::bitmapquals, BitmapOrPath::bitmapquals, BitmapAndPath::bitmapselectivity, BitmapOrPath::bitmapselectivity, castNode, clamp_row_est(), RestrictInfo::clause, create_indexscan_plan(), elog, ERROR, get_actual_clauses(), IndexPath::indexclauses, IndexScan::indexid, IndexPath::indexinfo, IndexScan::indexqual, IndexScan::indexqualorig, IndexClause::indexquals, IndexPath::indexselectivity, IndexPath::indextotalcost, IndexOptInfo::indpred, IsA, lappend(), lfirst, linitial, list_concat(), list_concat_unique(), list_length(), list_make1, make_ands_explicit(), make_bitmap_and(), make_bitmap_indexscan(), make_bitmap_or(), make_orclause(), NIL, nodeTag, Path::parallel_safe, IndexPath::path, BitmapAndPath::path, BitmapOrPath::path, plan, predicate_implied_by(), IndexClause::rinfo, root, IndexScan::scan, Scan::scanrelid, Path::startup_cost, and Path::total_cost.
Referenced by create_bitmap_scan_plan().
|
static |
Definition at line 3890 of file createplan.c.
References Assert, copy_generic_path_info(), PlannerInfo::cte_plan_ids, RangeTblEntry::ctelevelsup, Query::cteList, RangeTblEntry::ctename, CommonTableExpr::ctename, elog, ERROR, extract_actual_clauses(), PlannerInfo::init_plans, lfirst, linitial_int, list_length(), list_nth_int(), make_ctescan(), order_qual_clauses(), PlannerInfo::parse, SubPlan::plan_id, planner_rt_fetch, replace_nestloop_params(), root, RTE_CTE, RangeTblEntry::rtekind, CteScan::scan, and SubPlan::setParam.
Referenced by create_scan_plan().
|
static |
Definition at line 4276 of file createplan.c.
References castNode, copy_generic_path_info(), CP_EXACT_TLIST, create_plan_recurse(), CustomScan::custom_exprs, CustomPath::custom_paths, CustomScan::custom_relids, lappend(), lfirst, CustomPath::methods, NIL, order_qual_clauses(), CustomPath::path, plan, CustomPathMethods::PlanCustomPath, replace_nestloop_params(), root, and CustomScan::scan.
Referenced by create_scan_plan().
|
static |
Definition at line 4121 of file createplan.c.
References Assert, RelOptInfo::baserestrictinfo, bms_difference(), bms_free(), bms_is_member(), ForeignScan::checkAsUser, RestrictInfo::clause, copy_generic_path_info(), CP_EXACT_TLIST, create_plan_recurse(), PathTarget::exprs, ForeignScan::fdw_exprs, ForeignPath::fdw_outerpath, ForeignScan::fdw_recheck_quals, FirstLowInvalidHeapAttributeNumber, ForeignScan::fs_base_relids, ForeignScan::fs_relids, ForeignScan::fs_server, ForeignScan::fsSystemCol, i, InvalidOid, lfirst, order_qual_clauses(), ForeignPath::path, planner_rt_fetch, pull_varattnos(), RangeTblEntry::relid, RelOptInfo::relid, RELOPT_UPPER_REL, RelOptInfo::reloptkind, RelOptInfo::reltarget, replace_nestloop_params(), root, RTE_RELATION, RangeTblEntry::rtekind, RelOptInfo::rtekind, ForeignScan::scan, RelOptInfo::serverid, RelOptInfo::userid, and RelOptInfo::useridiscurrent.
Referenced by create_scan_plan().
|
static |
Definition at line 3760 of file createplan.c.
References Assert, copy_generic_path_info(), extract_actual_clauses(), RangeTblEntry::funcordinality, functions, RangeTblEntry::functions, make_functionscan(), order_qual_clauses(), planner_rt_fetch, replace_nestloop_params(), root, RTE_FUNCTION, RangeTblEntry::rtekind, and FunctionScan::scan.
Referenced by create_scan_plan().
|
static |
Definition at line 1961 of file createplan.c.
References Assert, assign_special_exec_param(), build_path_tlist(), copy_generic_path_info(), CP_EXACT_TLIST, create_plan_recurse(), Plan::lefttree, makeNode, NIL, GatherMergePath::num_workers, GatherMerge::num_workers, GatherMerge::numCols, GatherMergePath::path, Path::pathkeys, pathkeys_contained_in(), GatherMerge::plan, prepare_sort_from_pathkeys(), GatherMerge::rescan_param, root, GatherMergePath::subpath, and Plan::targetlist.
Referenced by create_plan_recurse().
|
static |
Definition at line 1923 of file createplan.c.
References assign_special_exec_param(), build_path_tlist(), copy_generic_path_info(), CP_EXACT_TLIST, create_plan_recurse(), make_gather(), NIL, GatherPath::num_workers, GatherPath::path, Gather::plan, root, GatherPath::single_copy, and GatherPath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 1025 of file createplan.c.
References Assert, build_path_tlist(), copy_plan_costsize(), IsA, Plan::lefttree, make_result(), Path::parallel_safe, Plan::parallel_safe, Result::plan, plan, Result::resconstantqual, root, and splan.
Referenced by create_join_plan(), and create_scan_plan().
|
static |
Definition at line 2240 of file createplan.c.
References build_path_tlist(), copy_generic_path_info(), CP_LABEL_TLIST, create_plan_recurse(), extract_grouping_collations(), extract_grouping_cols(), extract_grouping_ops(), GroupPath::groupClause, list_length(), make_group(), order_qual_clauses(), GroupPath::path, plan, GroupPath::qual, root, GroupPath::subpath, and Plan::targetlist.
Referenced by create_plan_recurse().
|
static |
Definition at line 1590 of file createplan.c.
References build_path_tlist(), copy_generic_path_info(), make_result(), order_qual_clauses(), GroupResultPath::path, plan, GroupResultPath::quals, and root.
Referenced by create_plan_recurse().
|
static |
Definition at line 2391 of file createplan.c.
References AGG_HASHED, AGG_PLAIN, AGG_SORTED, AGGSPLIT_SIMPLE, GroupingSetsPath::aggstrategy, Assert, build_path_tlist(), copy_generic_path_info(), CP_LABEL_TLIST, create_plan_recurse(), extract_grouping_collations(), extract_grouping_ops(), for_each_from, get_sortgroupclause_tle(), RollupData::groupClause, RollupData::gsets, RollupData::is_hashed, lappend(), Plan::lefttree, lfirst, linitial, list_length(), make_agg(), make_sort_from_groupcols(), NIL, RollupData::numGroups, palloc0(), GroupingSetsPath::path, plan, GroupingSetsPath::qual, remap_groupColIdx(), TargetEntry::resno, GroupingSetsPath::rollups, root, GroupingSetsPath::subpath, Plan::targetlist, SortGroupClause::tleSortGroupRef, and GroupingSetsPath::transitionSpace.
Referenced by create_plan_recurse().
|
static |
Definition at line 4790 of file createplan.c.
References OpExpr::args, Assert, build_path_tlist(), copy_generic_path_info(), copy_plan_costsize(), CP_SMALL_TLIST, create_plan_recurse(), extract_actual_clauses(), extract_actual_join_clauses(), get_actual_clauses(), get_switched_clauses(), RangeTblEntry::inh, HashPath::inner_rows_total, JoinPath::inner_unique, JoinPath::innerjoinpath, InvalidAttrNumber, InvalidOid, is_opclause(), IS_OUTER_JOIN, IsA, HashJoin::join, JoinPath::joinrestrictinfo, JoinPath::jointype, HashPath::jpath, lappend(), lappend_oid(), lfirst_node, linitial, list_difference(), list_length(), lsecond, make_hash(), make_hashjoin(), NIL, HashPath::num_batches, OpExpr::opno, order_qual_clauses(), JoinPath::outerjoinpath, Plan::parallel_aware, HashPath::path_hashclauses, Hash::plan, RangeTblEntry::relid, replace_nestloop_params(), root, Hash::rows_total, RTE_RELATION, RangeTblEntry::rtekind, Plan::startup_cost, Plan::total_cost, Var::varattno, and Var::varno.
Referenced by create_join_plan().
|
static |
Definition at line 2213 of file createplan.c.
References copy_generic_path_info(), CP_SMALL_TLIST, create_plan_recurse(), IS_OTHER_REL, make_incrementalsort_from_pathkeys(), IncrementalSortPath::nPresortedCols, SortPath::path, Path::pathkeys, plan, root, IncrementalSortPath::spath, and SortPath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 3005 of file createplan.c.
References Assert, BackwardScanDirection, RestrictInfo::clause, contain_mutable_functions(), copy_generic_path_info(), elog, ERROR, exprType(), extract_actual_clauses(), fix_indexorderby_references(), fix_indexqual_references(), forboth, ForwardScanDirection, get_opfamily_member(), i, IndexPath::indexclauses, IndexPath::indexinfo, IndexOptInfo::indexoid, IndexPath::indexorderbys, IndexPath::indexscandir, IndexOptInfo::indextlist, is_redundant_with_indexclauses(), lappend(), lappend_oid(), lfirst, lfirst_node, list_length(), list_make1, make_indexonlyscan(), make_indexscan(), NIL, OidIsValid, order_qual_clauses(), IndexPath::path, Path::pathkeys, PathKey::pk_opfamily, PathKey::pk_strategy, predicate_implied_by(), replace_nestloop_params(), root, and RTE_RELATION.
Referenced by create_bitmap_subplan(), and create_scan_plan().
|
static |
Definition at line 1084 of file createplan.c.
References create_gating_plan(), create_hashjoin_plan(), create_mergejoin_plan(), create_nestloop_plan(), elog, ERROR, get_actual_clauses(), get_gating_quals(), JoinPath::joinrestrictinfo, list_concat(), NIL, plan, and root.
Referenced by create_plan_recurse().
|
static |
Definition at line 2855 of file createplan.c.
References copy_generic_path_info(), create_plan_recurse(), SortGroupClause::eqop, TargetEntry::expr, exprCollation(), get_sortgroupclause_tle(), lfirst, LIMIT_OPTION_WITH_TIES, LimitPath::limitCount, LimitPath::limitOffset, LimitPath::limitOption, list_length(), make_limit(), palloc(), parse(), plan, TargetEntry::resno, root, and LimitPath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 2791 of file createplan.c.
References copy_generic_path_info(), create_plan_recurse(), LockRowsPath::epqParam, make_lockrows(), plan, root, LockRowsPath::rowMarks, and LockRowsPath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 1641 of file createplan.c.
References copy_generic_path_info(), CP_SMALL_TLIST, create_plan_recurse(), make_material(), plan, root, and MaterialPath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 1669 of file createplan.c.
References Assert, MemoizePath::binary_mode, copy_generic_path_info(), CP_SMALL_TLIST, create_plan_recurse(), MemoizePath::est_entries, exprCollation(), forboth, MemoizePath::hash_operators, i, lfirst, lfirst_oid, list_length(), make_memoize(), NIL, palloc(), MemoizePath::param_exprs, plan, pull_paramids(), replace_nestloop_params(), root, MemoizePath::singlerow, and MemoizePath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 1440 of file createplan.c.
References MergeAppend::apprelids, Assert, RelOptInfo::baserestrictinfo, build_path_tlist(), copy_generic_path_info(), CP_EXACT_TLIST, CP_SMALL_TLIST, create_plan_recurse(), elog, enable_partition_pruning, ERROR, extract_actual_clauses(), inject_projection_plan(), label_sort_with_costsize(), lappend(), lfirst, MergeAppendPath::limit_tuples, list_copy_head(), list_length(), make_partition_pruneinfo(), make_sort(), makeNode, MergeAppend::mergeplans, NIL, MergeAppend::numCols, MergeAppend::part_prune_info, MergeAppendPath::path, Path::pathkeys, pathkeys_contained_in(), MergeAppend::plan, plan, prepare_sort_from_pathkeys(), RelOptInfo::relids, root, sort(), subpath(), and MergeAppendPath::subpaths.
Referenced by create_plan_recurse().
|
static |
Definition at line 4439 of file createplan.c.
References Assert, BTGreaterStrategyNumber, build_path_tlist(), copy_generic_path_info(), copy_plan_costsize(), CP_SMALL_TLIST, cpu_operator_cost, create_plan_recurse(), elog, enable_incremental_sort, ERROR, extract_actual_clauses(), extract_actual_join_clauses(), get_actual_clauses(), get_switched_clauses(), i, JoinPath::inner_unique, JoinPath::innerjoinpath, MergePath::innersortkeys, IS_OUTER_JOIN, MergeJoin::join, JoinPath::joinrestrictinfo, JoinPath::jointype, MergePath::jpath, label_incrementalsort_with_costsize(), label_sort_with_costsize(), lfirst, lfirst_node, list_difference(), list_head(), list_length(), lnext(), make_incrementalsort_from_pathkeys(), make_material(), make_mergejoin(), make_sort_from_pathkeys(), MergePath::materialize_inner, NIL, order_qual_clauses(), JoinPath::outerjoinpath, MergePath::outersortkeys, palloc(), MergePath::path_mergeclauses, Path::pathkeys, pathkeys_count_contained_in(), PG_USED_FOR_ASSERTS_ONLY, PathKey::pk_nulls_first, PathKey::pk_opfamily, PathKey::pk_strategy, Plan::plan_rows, replace_nestloop_params(), root, MergePath::skip_mark_restore, sort(), Plan::total_cost, and true.
Referenced by create_join_plan().
|
static |
Definition at line 2549 of file createplan.c.
References Assert, build_path_tlist(), copy_generic_path_info(), create_plan(), Path::disabled_nodes, lfirst, Query::limitCount, Query::limitOffset, Query::limitOption, make_limit(), make_result(), MinMaxAggPath::mmaggregates, NIL, Path::parallel_safe, MinMaxAggInfo::param, PlannerInfo::parse, MinMaxAggPath::path, MinMaxAggInfo::path, MinMaxAggInfo::pathcost, plan, MinMaxAggPath::quals, root, SS_make_initplan_from_plan(), and Path::startup_cost.
Referenced by create_plan_recurse().
|
static |
Definition at line 2814 of file createplan.c.
References apply_tlist_labeling(), ModifyTablePath::canSetTag, copy_generic_path_info(), CP_EXACT_TLIST, create_plan_recurse(), ModifyTablePath::epqParam, make_modifytable(), ModifyTablePath::mergeActionLists, ModifyTablePath::mergeJoinConditions, ModifyTablePath::nominalRelation, ModifyTablePath::onconflict, ModifyTablePath::operation, ModifyTablePath::partColsUpdated, ModifyTablePath::path, plan, ModifyTablePath::resultRelations, ModifyTablePath::returningLists, root, ModifyTablePath::rootRelation, ModifyTablePath::rowMarks, subpath(), ModifyTablePath::subpath, Plan::targetlist, ModifyTablePath::updateColnosLists, and ModifyTablePath::withCheckOptionLists.
Referenced by create_plan_recurse().
|
static |
Definition at line 3985 of file createplan.c.
References Assert, copy_generic_path_info(), RangeTblEntry::enrname, extract_actual_clauses(), make_namedtuplestorescan(), order_qual_clauses(), planner_rt_fetch, replace_nestloop_params(), root, RTE_NAMEDTUPLESTORE, RangeTblEntry::rtekind, and NamedTuplestoreScan::scan.
Referenced by create_scan_plan().
|
static |
Definition at line 4347 of file createplan.c.
References Assert, bms_free(), bms_union(), build_path_tlist(), copy_generic_path_info(), create_plan_recurse(), extract_actual_clauses(), extract_actual_join_clauses(), identify_current_nestloop_params(), JoinPath::inner_unique, JoinPath::innerjoinpath, IS_OUTER_JOIN, NestLoop::join, JoinPath::joinrestrictinfo, JoinPath::jointype, NestPath::jpath, make_nestloop(), NIL, order_qual_clauses(), JoinPath::outerjoinpath, reparameterize_path_by_child(), replace_nestloop_params(), and root.
Referenced by create_join_plan().
Plan* create_plan | ( | PlannerInfo * | root, |
Path * | best_path | ||
) |
Definition at line 340 of file createplan.c.
References apply_tlist_labeling(), Assert, CP_EXACT_TLIST, create_plan_recurse(), elog, ERROR, IsA, NIL, plan, root, and SS_attach_initplans().
Referenced by create_minmaxagg_plan(), create_subqueryscan_plan(), make_subplan(), SS_process_ctes(), and standard_planner().
|
static |
Definition at line 391 of file createplan.c.
References Assert, check_stack_depth(), create_agg_plan(), create_append_plan(), create_gather_merge_plan(), create_gather_plan(), create_group_plan(), create_group_result_plan(), create_groupingsets_plan(), create_incrementalsort_plan(), create_join_plan(), create_limit_plan(), create_lockrows_plan(), create_material_plan(), create_memoize_plan(), create_merge_append_plan(), create_minmaxagg_plan(), create_modifytable_plan(), create_project_set_plan(), create_projection_plan(), create_recursiveunion_plan(), create_scan_plan(), create_setop_plan(), create_sort_plan(), create_unique_plan(), create_upper_unique_plan(), create_windowagg_plan(), elog, ERROR, IsA, Path::pathtype, plan, and root.
Referenced by create_agg_plan(), create_append_plan(), create_customscan_plan(), create_foreignscan_plan(), create_gather_merge_plan(), create_gather_plan(), create_group_plan(), create_groupingsets_plan(), create_hashjoin_plan(), create_incrementalsort_plan(), create_limit_plan(), create_lockrows_plan(), create_material_plan(), create_memoize_plan(), create_merge_append_plan(), create_mergejoin_plan(), create_modifytable_plan(), create_nestloop_plan(), create_plan(), create_project_set_plan(), create_projection_plan(), create_recursiveunion_plan(), create_setop_plan(), create_sort_plan(), create_unique_plan(), create_upper_unique_plan(), and create_windowagg_plan().
|
static |
Definition at line 1615 of file createplan.c.
References build_path_tlist(), copy_generic_path_info(), create_plan_recurse(), make_project_set(), ProjectSetPath::path, plan, root, and ProjectSetPath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 2017 of file createplan.c.
References apply_pathtarget_labeling_to_tlist(), Assert, build_path_tlist(), copy_generic_path_info(), CP_IGNORE_TLIST, CP_LABEL_TLIST, create_plan_recurse(), is_projection_capable_path(), is_projection_capable_plan(), make_result(), Path::parallel_safe, ProjectionPath::path, plan, root, Path::rows, Path::startup_cost, ProjectionPath::subpath, Plan::targetlist, tlist_same_exprs(), Path::total_cost, and use_physical_tlist().
Referenced by create_plan_recurse().
|
static |
Definition at line 2755 of file createplan.c.
References build_path_tlist(), clamp_cardinality_to_long(), copy_generic_path_info(), CP_EXACT_TLIST, create_plan_recurse(), RecursiveUnionPath::distinctList, RecursiveUnionPath::leftpath, make_recursive_union(), RecursiveUnionPath::numGroups, RecursiveUnionPath::path, plan, RecursiveUnionPath::rightpath, root, and RecursiveUnionPath::wtParam.
Referenced by create_plan_recurse().
|
static |
Definition at line 4024 of file createplan.c.
References Assert, copy_generic_path_info(), extract_actual_clauses(), make_result(), order_qual_clauses(), PG_USED_FOR_ASSERTS_ONLY, Result::plan, planner_rt_fetch, replace_nestloop_params(), root, and RTE_RESULT.
Referenced by create_scan_plan().
|
static |
Definition at line 2954 of file createplan.c.
References Assert, copy_generic_path_info(), extract_actual_clauses(), make_samplescan(), order_qual_clauses(), planner_rt_fetch, replace_nestloop_params(), root, RTE_RELATION, RangeTblEntry::rtekind, SampleScan::scan, and RangeTblEntry::tablesample.
Referenced by create_scan_plan().
|
static |
Definition at line 562 of file createplan.c.
References apply_pathtarget_labeling_to_tlist(), Assert, RelOptInfo::baserestrictinfo, build_path_tlist(), build_physical_tlist(), castNode, copyObject, CP_IGNORE_TLIST, CP_LABEL_TLIST, create_bitmap_scan_plan(), create_ctescan_plan(), create_customscan_plan(), create_foreignscan_plan(), create_functionscan_plan(), create_gating_plan(), create_indexscan_plan(), create_namedtuplestorescan_plan(), create_resultscan_plan(), create_samplescan_plan(), create_seqscan_plan(), create_subqueryscan_plan(), create_tablefuncscan_plan(), create_tidrangescan_plan(), create_tidscan_plan(), create_valuesscan_plan(), create_worktablescan_plan(), elog, ERROR, get_gating_quals(), IS_JOIN_REL, list_concat_copy(), NIL, Path::pathtype, plan, root, and use_physical_tlist().
Referenced by create_plan_recurse().
|
static |
Definition at line 2916 of file createplan.c.
References Assert, copy_generic_path_info(), extract_actual_clauses(), make_seqscan(), order_qual_clauses(), replace_nestloop_params(), root, RTE_RELATION, and SeqScan::scan.
Referenced by create_scan_plan().
|
static |
Definition at line 2719 of file createplan.c.
References clamp_cardinality_to_long(), SetOpPath::cmd, copy_generic_path_info(), CP_LABEL_TLIST, create_plan_recurse(), SetOpPath::distinctList, SetOpPath::firstFlag, SetOpPath::flagColIdx, make_setop(), SetOpPath::numGroups, plan, root, SetOpPath::strategy, and SetOpPath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 2179 of file createplan.c.
References copy_generic_path_info(), CP_SMALL_TLIST, create_plan_recurse(), IS_OTHER_REL, make_sort_from_pathkeys(), SortPath::path, Path::pathkeys, plan, root, and SortPath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 3701 of file createplan.c.
References Assert, copy_generic_path_info(), create_plan(), extract_actual_clauses(), make_subqueryscan(), order_qual_clauses(), SubqueryScanPath::path, process_subquery_nestloop_params(), RelOptInfo::relid, replace_nestloop_params(), root, RTE_SUBQUERY, RelOptInfo::rtekind, SubqueryScan::scan, SubqueryScanPath::subpath, RelOptInfo::subplan_params, and RelOptInfo::subroot.
Referenced by create_scan_plan().
|
static |
Definition at line 3803 of file createplan.c.
References Assert, copy_generic_path_info(), extract_actual_clauses(), make_tablefuncscan(), order_qual_clauses(), planner_rt_fetch, replace_nestloop_params(), root, RTE_TABLEFUNC, RangeTblEntry::rtekind, TableFuncScan::scan, and RangeTblEntry::tablefunc.
Referenced by create_scan_plan().
|
static |
Definition at line 3636 of file createplan.c.
References Assert, copy_generic_path_info(), extract_actual_clauses(), lappend(), lfirst_node, list_member_ptr(), make_tidrangescan(), NIL, order_qual_clauses(), TidRangePath::path, replace_nestloop_params(), root, RTE_RELATION, TidRangeScan::scan, and TidRangePath::tidrangequals.
Referenced by create_scan_plan().
|
static |
Definition at line 3539 of file createplan.c.
References Assert, copy_generic_path_info(), extract_actual_clauses(), is_redundant_derived_clause(), lappend(), lfirst_node, list_difference(), list_length(), list_make1, list_member_ptr(), make_orclause(), make_tidscan(), NIL, order_qual_clauses(), TidPath::path, replace_nestloop_params(), root, RTE_RELATION, TidScan::scan, and TidPath::tidquals.
Referenced by create_scan_plan().
|
static |
Definition at line 1723 of file createplan.c.
References AGG_HASHED, AGGSPLIT_SIMPLE, Assert, assignSortGroupRef(), build_path_tlist(), change_plan_targetlist(), copy_generic_path_info(), create_plan_recurse(), elog, SortGroupClause::eqop, ERROR, TargetEntry::expr, exprCollation(), get_compatible_hash_operators(), get_equality_op_for_ordering_op(), get_ordering_op_for_equality_op(), get_tle_by_resno(), UniquePath::in_operators, label_sort_with_costsize(), lappend(), lfirst, lfirst_oid, list_length(), make_agg(), make_sort_from_sortclauses(), make_unique_from_sortclauses(), makeNode, makeTargetEntry(), NIL, SortGroupClause::nulls_first, OidIsValid, palloc(), Path::parallel_safe, UniquePath::path, plan, TargetEntry::resno, SortGroupClause::reverse_sort, root, Path::rows, sort(), SortGroupClause::sortop, UniquePath::subpath, Plan::targetlist, SortGroupClause::tleSortGroupRef, tlist_member(), UniquePath::umethod, UniquePath::uniq_exprs, UNIQUE_PATH_HASH, UNIQUE_PATH_NOOP, and UNIQUE_PATH_SORT.
Referenced by create_plan_recurse().
|
static |
Definition at line 2279 of file createplan.c.
References copy_generic_path_info(), CP_LABEL_TLIST, create_plan_recurse(), make_unique_from_pathkeys(), UpperUniquePath::numkeys, UpperUniquePath::path, Path::pathkeys, plan, root, and UpperUniquePath::subpath.
Referenced by create_plan_recurse().
|
static |
Definition at line 3846 of file createplan.c.
References Assert, copy_generic_path_info(), extract_actual_clauses(), make_valuesscan(), order_qual_clauses(), planner_rt_fetch, replace_nestloop_params(), root, RTE_VALUES, RangeTblEntry::rtekind, ValuesScan::scan, and RangeTblEntry::values_lists.
Referenced by create_scan_plan().
|
static |
Definition at line 2616 of file createplan.c.
References Assert, build_path_tlist(), copy_generic_path_info(), CP_LABEL_TLIST, CP_SMALL_TLIST, create_plan_recurse(), WindowClause::endOffset, SortGroupClause::eqop, TargetEntry::expr, exprCollation(), WindowClause::frameOptions, get_sortgroupclause_tle(), lfirst, list_length(), make_windowagg(), OidIsValid, WindowClause::orderClause, palloc(), WindowClause::partitionClause, WindowAggPath::path, plan, WindowAggPath::qual, TargetEntry::resno, root, WindowAggPath::runCondition, WindowClause::startOffset, WindowAggPath::subpath, Plan::targetlist, WindowAggPath::topwindow, WindowAggPath::winclause, and WindowClause::winref.
Referenced by create_plan_recurse().
|
static |
Definition at line 4061 of file createplan.c.
References Assert, copy_generic_path_info(), RangeTblEntry::ctelevelsup, RangeTblEntry::ctename, elog, ERROR, extract_actual_clauses(), make_worktablescan(), order_qual_clauses(), planner_rt_fetch, replace_nestloop_params(), root, RTE_CTE, RangeTblEntry::rtekind, WorkTableScan::scan, and PlannerInfo::wt_param_id.
Referenced by create_scan_plan().
|
static |
Definition at line 5107 of file createplan.c.
References fix_indexqual_clause(), forboth, IndexPath::indexinfo, IndexPath::indexorderbycols, IndexPath::indexorderbys, lappend(), lfirst, lfirst_int, NIL, and root.
Referenced by create_indexscan_plan().
|
static |
Definition at line 5136 of file createplan.c.
References NullTest::arg, OpExpr::args, ScalarArrayOpExpr::args, Assert, elog, ERROR, fix_indexqual_operand(), forboth, IsA, RowCompareExpr::largs, lca(), lfirst, lfirst_int, linitial, list_length(), nodeTag, replace_nestloop_params(), and root.
Referenced by fix_indexorderby_references(), and fix_indexqual_references().
|
static |
Definition at line 5207 of file createplan.c.
References arg, Assert, copyObject, elog, equal(), ERROR, exprCollation(), exprType(), INDEX_VAR, IsA, lfirst, list_head(), lnext(), makeVar(), Var::varattno, and Var::varno.
Referenced by fix_indexqual_clause().
|
static |
Definition at line 5066 of file createplan.c.
References RestrictInfo::clause, fix_indexqual_clause(), IndexPath::indexclauses, IndexClause::indexcol, IndexClause::indexcols, IndexPath::indexinfo, IndexClause::indexquals, lappend(), lfirst_node, NIL, and root.
Referenced by create_indexscan_plan().
|
static |
Definition at line 1005 of file createplan.c.
References extract_actual_clauses(), NIL, order_qual_clauses(), and root.
Referenced by create_join_plan(), and create_scan_plan().
Definition at line 5282 of file createplan.c.
References OpExpr::args, Assert, bms_is_subset(), RestrictInfo::clause, CommuteOpExpr(), InvalidOid, is_opclause(), lappend(), lfirst, list_copy(), OpExpr::location, makeNode, NIL, and OpExpr::opno.
Referenced by create_hashjoin_plan(), and create_mergejoin_plan().
Definition at line 2119 of file createplan.c.
References copy_plan_costsize(), make_result(), and plan.
Referenced by change_plan_targetlist(), create_append_plan(), create_merge_append_plan(), and prepare_sort_from_pathkeys().
Definition at line 7296 of file createplan.c.
References castNode, CUSTOMPATH_SUPPORT_PROJECTION, IS_DUMMY_APPEND, and Path::pathtype.
Referenced by add_paths_with_pathkeys_for_rel(), apply_projection_to_path(), create_projection_path(), and create_projection_plan().
Definition at line 7346 of file createplan.c.
References CUSTOMPATH_SUPPORT_PROJECTION, nodeTag, and plan.
Referenced by change_plan_targetlist(), create_projection_plan(), and prepare_sort_from_pathkeys().
|
static |
Definition at line 5520 of file createplan.c.
References Assert, cost_incremental_sort(), IsA, Plan::parallel_safe, plan, Plan::plan_rows, Plan::plan_width, root, Path::startup_cost, Plan::startup_cost, Path::total_cost, Plan::total_cost, and work_mem.
Referenced by create_mergejoin_plan().
|
static |
Definition at line 5492 of file createplan.c.
References Assert, cost_sort(), IsA, NIL, Plan::parallel_safe, plan, Plan::plan_rows, Plan::plan_width, root, Path::startup_cost, Path::total_cost, Plan::total_cost, and work_mem.
Referenced by create_append_plan(), create_merge_append_plan(), create_mergejoin_plan(), and create_unique_plan().
Agg* make_agg | ( | List * | tlist, |
List * | qual, | ||
AggStrategy | aggstrategy, | ||
AggSplit | aggsplit, | ||
int | numGroupCols, | ||
AttrNumber * | grpColIdx, | ||
Oid * | grpOperators, | ||
Oid * | grpCollations, | ||
List * | groupingSets, | ||
List * | chain, | ||
double | dNumGroups, | ||
Size | transitionSpace, | ||
Plan * | lefttree | ||
) |
Definition at line 6670 of file createplan.c.
References Agg::aggParams, Agg::aggsplit, Agg::aggstrategy, Agg::chain, clamp_cardinality_to_long(), Agg::groupingSets, makeNode, Agg::numCols, Agg::numGroups, Agg::plan, plan, and Agg::transitionSpace.
Referenced by create_agg_plan(), create_groupingsets_plan(), and create_unique_plan().
Definition at line 5992 of file createplan.c.
References BitmapAnd::bitmapplans, makeNode, NIL, BitmapAnd::plan, and plan.
Referenced by create_bitmap_subplan().
|
static |
Definition at line 5699 of file createplan.c.
References BitmapHeapScan::bitmapqualorig, makeNode, plan, BitmapHeapScan::scan, and Scan::scanrelid.
Referenced by create_bitmap_scan_plan().
|
static |
Definition at line 5678 of file createplan.c.
References BitmapIndexScan::indexid, BitmapIndexScan::indexqual, BitmapIndexScan::indexqualorig, makeNode, NIL, plan, BitmapIndexScan::scan, and Scan::scanrelid.
Referenced by create_bitmap_subplan().
Definition at line 6007 of file createplan.c.
References BitmapOr::bitmapplans, makeNode, NIL, BitmapOr::plan, and plan.
Referenced by create_bitmap_subplan().
|
static |
Definition at line 5836 of file createplan.c.
References CteScan::cteParam, CteScan::ctePlanId, makeNode, plan, CteScan::scan, and Scan::scanrelid.
Referenced by create_ctescan_plan().
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 | ||
) |
Definition at line 5896 of file createplan.c.
References ForeignScan::checkAsUser, CMD_SELECT, ForeignScan::fdw_exprs, ForeignScan::fdw_private, ForeignScan::fdw_recheck_quals, ForeignScan::fdw_scan_tlist, ForeignScan::fs_base_relids, ForeignScan::fs_relids, ForeignScan::fs_server, ForeignScan::fsSystemCol, InvalidOid, makeNode, ForeignScan::operation, plan, ForeignScan::resultRelation, ForeignScan::scan, and Scan::scanrelid.
Referenced by fileGetForeignPlan(), and postgresGetForeignPlan().
|
static |
Definition at line 5777 of file createplan.c.
References FunctionScan::funcordinality, functions, FunctionScan::functions, makeNode, plan, FunctionScan::scan, and Scan::scanrelid.
Referenced by create_functionscan_plan().
|
static |
Definition at line 6931 of file createplan.c.
References Gather::initParam, Gather::invisible, makeNode, Gather::num_workers, Gather::plan, plan, Gather::rescan_param, and Gather::single_copy.
Referenced by create_gather_plan().
|
static |
Definition at line 6746 of file createplan.c.
References makeNode, Group::numCols, Group::plan, and plan.
Referenced by create_group_plan().
|
static |
Definition at line 6078 of file createplan.c.
References Hash::hashkeys, makeNode, NIL, Hash::plan, plan, Hash::skewColumn, Hash::skewInherit, Hash::skewTable, and Plan::targetlist.
Referenced by create_hashjoin_plan().
|
static |
Definition at line 6047 of file createplan.c.
References HashJoin::hashclauses, HashJoin::hashcollations, HashJoin::hashkeys, HashJoin::hashoperators, Join::inner_unique, HashJoin::join, Join::joinqual, Join::jointype, makeNode, and plan.
Referenced by create_hashjoin_plan().
|
static |
Definition at line 6173 of file createplan.c.
References makeNode, NIL, IncrementalSort::nPresortedCols, Sort::numCols, Sort::plan, plan, IncrementalSort::sort, and Plan::targetlist.
Referenced by make_incrementalsort_from_pathkeys().
|
static |
Definition at line 6456 of file createplan.c.
References make_incrementalsort(), and prepare_sort_from_pathkeys().
Referenced by create_incrementalsort_plan(), and create_mergejoin_plan().
|
static |
Definition at line 5649 of file createplan.c.
References IndexOnlyScan::indexid, IndexOnlyScan::indexorderby, IndexOnlyScan::indexorderdir, IndexOnlyScan::indexqual, IndexOnlyScan::indextlist, makeNode, plan, IndexOnlyScan::recheckqual, IndexOnlyScan::scan, and Scan::scanrelid.
Referenced by create_indexscan_plan().
|
static |
Definition at line 5618 of file createplan.c.
References IndexScan::indexid, IndexScan::indexorderby, IndexScan::indexorderbyops, IndexScan::indexorderbyorig, IndexScan::indexorderdir, IndexScan::indexqual, IndexScan::indexqualorig, makeNode, plan, IndexScan::scan, and Scan::scanrelid.
Referenced by create_indexscan_plan().
Limit* make_limit | ( | Plan * | lefttree, |
Node * | limitOffset, | ||
Node * | limitCount, | ||
LimitOption | limitOption, | ||
int | uniqNumCols, | ||
AttrNumber * | uniqColIdx, | ||
Oid * | uniqOperators, | ||
Oid * | uniqCollations | ||
) |
Definition at line 7037 of file createplan.c.
References Limit::limitCount, Limit::limitOffset, Limit::limitOption, makeNode, NIL, Limit::plan, plan, Plan::targetlist, and Limit::uniqNumCols.
Referenced by create_limit_plan(), and create_minmaxagg_plan().
Definition at line 7016 of file createplan.c.
References LockRows::epqParam, makeNode, NIL, LockRows::plan, plan, LockRows::rowMarks, and Plan::targetlist.
Referenced by create_lockrows_plan().
Definition at line 6580 of file createplan.c.
References makeNode, NIL, Material::plan, plan, and Plan::targetlist.
Referenced by create_material_plan(), create_mergejoin_plan(), and materialize_finished_plan().
|
static |
Definition at line 6645 of file createplan.c.
References Memoize::binary_mode, Memoize::est_entries, Memoize::keyparamids, list_length(), makeNode, NIL, Memoize::numKeys, Memoize::param_exprs, Memoize::plan, plan, Memoize::singlerow, and Plan::targetlist.
Referenced by create_memoize_plan().
|
static |
Definition at line 6101 of file createplan.c.
References Join::inner_unique, MergeJoin::join, Join::joinqual, Join::jointype, makeNode, MergeJoin::mergeclauses, plan, and MergeJoin::skip_mark_restore.
Referenced by create_mergejoin_plan().
|
static |
Definition at line 7105 of file createplan.c.
References OnConflictExpr::action, ModifyTable::arbiterIndexes, Assert, FdwRoutine::BeginDirectModify, bms_add_member(), ModifyTable::canSetTag, CMD_MERGE, CMD_UPDATE, FdwRoutine::EndDirectModify, ModifyTable::epqParam, ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, OnConflictExpr::exclRelIndex, ModifyTable::exclRelRTI, ModifyTable::exclRelTlist, OnConflictExpr::exclRelTlist, extract_update_targetlist_colnos(), ModifyTable::fdwDirectModifyPlans, ModifyTable::fdwPrivLists, FirstNormalObjectId, get_rel_name(), GetFdwRoutineByRelId(), has_row_triggers(), has_stored_generated_columns(), i, infer_arbiter_indexes(), FdwRoutine::IterateDirectModify, lappend(), Plan::lefttree, lfirst_int, list_length(), makeNode, ModifyTable::mergeActionLists, ModifyTable::mergeJoinConditions, NIL, ModifyTable::nominalRelation, ONCONFLICT_NONE, ModifyTable::onConflictAction, ModifyTable::onConflictCols, ModifyTable::onConflictSet, OnConflictExpr::onConflictSet, ModifyTable::onConflictWhere, OnConflictExpr::onConflictWhere, ModifyTable::operation, ModifyTable::partColsUpdated, ModifyTable::plan, FdwRoutine::PlanDirectModify, FdwRoutine::PlanForeignModify, planner_rt_fetch, Plan::qual, RangeTblEntry::relid, restrict_nonsystem_relation_kind, RESTRICT_RELKIND_FOREIGN_TABLE, ModifyTable::resultRelations, ModifyTable::returningLists, Plan::righttree, root, ModifyTable::rootRelation, ModifyTable::rowMarks, RTE_RELATION, RangeTblEntry::rtekind, Plan::targetlist, unlikely, ModifyTable::updateColnosLists, and ModifyTable::withCheckOptionLists.
Referenced by create_modifytable_plan().
|
static |
Definition at line 5857 of file createplan.c.
References NamedTuplestoreScan::enrname, makeNode, plan, NamedTuplestoreScan::scan, and Scan::scanrelid.
Referenced by create_namedtuplestorescan_plan().
|
static |
Definition at line 6022 of file createplan.c.
References Join::inner_unique, NestLoop::join, Join::joinqual, Join::jointype, makeNode, NestLoop::nestParams, and plan.
Referenced by create_nestloop_plan().
|
static |
Definition at line 7086 of file createplan.c.
References makeNode, NIL, ProjectSet::plan, and plan.
Referenced by create_project_set_plan().
|
static |
Definition at line 5936 of file createplan.c.
References Assert, SortGroupClause::eqop, TargetEntry::expr, exprCollation(), get_sortgroupclause_tle(), lfirst, list_length(), makeNode, NIL, RecursiveUnion::numCols, RecursiveUnion::numGroups, OidIsValid, palloc(), RecursiveUnion::plan, plan, TargetEntry::resno, and RecursiveUnion::wtParam.
Referenced by create_recursiveunion_plan().
Definition at line 7065 of file createplan.c.
References makeNode, NIL, Result::plan, plan, and Result::resconstantqual.
Referenced by create_append_plan(), create_gating_plan(), create_group_result_plan(), create_minmaxagg_plan(), create_projection_plan(), create_resultscan_plan(), and inject_projection_plan().
|
static |
Definition at line 5599 of file createplan.c.
References makeNode, plan, SampleScan::scan, Scan::scanrelid, and SampleScan::tablesample.
Referenced by create_samplescan_plan().
Definition at line 5582 of file createplan.c.
References makeNode, plan, SeqScan::scan, and Scan::scanrelid.
Referenced by create_seqscan_plan().
|
static |
Definition at line 6960 of file createplan.c.
References Assert, SetOp::cmd, SortGroupClause::eqop, TargetEntry::expr, exprCollation(), SetOp::firstFlag, SetOp::flagColIdx, get_sortgroupclause_tle(), lfirst, list_length(), makeNode, NIL, SetOp::numCols, SetOp::numGroups, OidIsValid, palloc(), SetOp::plan, plan, TargetEntry::resno, SetOp::strategy, and Plan::targetlist.
Referenced by create_setop_plan().
|
static |
Definition at line 6142 of file createplan.c.
References Plan::disabled_nodes, enable_sort, makeNode, NIL, Sort::numCols, Sort::plan, plan, and Plan::targetlist.
Referenced by create_append_plan(), create_merge_append_plan(), make_sort_from_groupcols(), make_sort_from_pathkeys(), and make_sort_from_sortclauses().
|
static |
Definition at line 6539 of file createplan.c.
References elog, ERROR, TargetEntry::expr, exprCollation(), get_tle_by_resno(), lfirst, list_length(), make_sort(), SortGroupClause::nulls_first, palloc(), TargetEntry::resno, SortGroupClause::sortop, and Plan::targetlist.
Referenced by create_groupingsets_plan().
Definition at line 6421 of file createplan.c.
References make_sort(), and prepare_sort_from_pathkeys().
Referenced by create_mergejoin_plan(), and create_sort_plan().
Definition at line 6490 of file createplan.c.
References TargetEntry::expr, exprCollation(), get_sortgroupclause_tle(), lfirst, list_length(), make_sort(), SortGroupClause::nulls_first, palloc(), TargetEntry::resno, SortGroupClause::sortop, and Plan::targetlist.
Referenced by create_unique_plan().
|
static |
Definition at line 5757 of file createplan.c.
References makeNode, plan, SubqueryScan::scan, Scan::scanrelid, SubqueryScan::scanstatus, SubqueryScan::subplan, and SUBQUERY_SCAN_UNKNOWN.
Referenced by create_subqueryscan_plan().
|
static |
Definition at line 5798 of file createplan.c.
References makeNode, plan, TableFuncScan::scan, Scan::scanrelid, and TableFuncScan::tablefunc.
Referenced by create_tablefuncscan_plan().
|
static |
Definition at line 5738 of file createplan.c.
References makeNode, plan, TidRangeScan::scan, Scan::scanrelid, and TidRangeScan::tidrangequals.
Referenced by create_tidrangescan_plan().
|
static |
Definition at line 5719 of file createplan.c.
References makeNode, plan, TidScan::scan, Scan::scanrelid, and TidScan::tidquals.
Referenced by create_tidscan_plan().
Definition at line 6825 of file createplan.c.
References Assert, BTEqualStrategyNumber, EquivalenceClass::ec_collation, EquivalenceClass::ec_has_volatile, EquivalenceClass::ec_members, EquivalenceClass::ec_sortref, elog, EquivalenceMember::em_datatype, ERROR, TargetEntry::expr, find_ec_member_matching_expr(), get_opfamily_member(), get_sortgroupref_tle(), InvalidOid, j, lfirst, linitial, list_length(), makeNode, NIL, Unique::numCols, OidIsValid, palloc(), PathKey::pk_opfamily, Unique::plan, plan, TargetEntry::resno, and Plan::targetlist.
Referenced by create_upper_unique_plan().
Definition at line 6776 of file createplan.c.
References Assert, SortGroupClause::eqop, TargetEntry::expr, exprCollation(), get_sortgroupclause_tle(), lfirst, list_length(), makeNode, NIL, Unique::numCols, OidIsValid, palloc(), Unique::plan, plan, TargetEntry::resno, and Plan::targetlist.
Referenced by create_unique_plan().
|
static |
Definition at line 5817 of file createplan.c.
References makeNode, plan, ValuesScan::scan, Scan::scanrelid, and ValuesScan::values_lists.
Referenced by create_valuesscan_plan().
|
static |
Definition at line 6704 of file createplan.c.
References WindowAgg::endInRangeFunc, WindowAgg::endOffset, WindowAgg::frameOptions, WindowAgg::inRangeAsc, WindowAgg::inRangeColl, WindowAgg::inRangeNullsFirst, makeNode, WindowAgg::ordNumCols, WindowAgg::partNumCols, WindowAgg::plan, plan, WindowAgg::runCondition, WindowAgg::runConditionOrig, WindowAgg::startInRangeFunc, WindowAgg::startOffset, WindowAgg::topWindow, and WindowAgg::winref.
Referenced by create_windowagg_plan().
|
static |
Definition at line 5877 of file createplan.c.
References makeNode, plan, WorkTableScan::scan, Scan::scanrelid, and WorkTableScan::wtParam.
Referenced by create_worktablescan_plan().
Definition at line 1143 of file createplan.c.
References Assert, IsA, FdwRoutine::IsForeignPathAsyncCapable, nodeTag, plan, subpath(), SubqueryScan::subplan, and trivial_subqueryscan().
Referenced by create_append_plan().
Definition at line 6602 of file createplan.c.
References cost_material(), Plan::disabled_nodes, Plan::initPlan, make_material(), NIL, Plan::parallel_aware, Plan::parallel_safe, Plan::plan_rows, Plan::plan_width, SS_compute_initplan_cost(), Path::startup_cost, Plan::startup_cost, Path::total_cost, and Plan::total_cost.
Referenced by build_subplan(), and standard_planner().
|
static |
Definition at line 5359 of file createplan.c.
References cost_qual_eval_node(), cpu_operator_cost, i, IsA, items, j, lappend(), lfirst, list_length(), NIL, nitems, palloc(), QualCost::per_tuple, root, and RestrictInfo::security_level.
Referenced by create_agg_plan(), create_bitmap_scan_plan(), create_ctescan_plan(), create_customscan_plan(), create_foreignscan_plan(), create_functionscan_plan(), create_group_plan(), create_group_result_plan(), create_hashjoin_plan(), create_indexscan_plan(), create_mergejoin_plan(), create_namedtuplestorescan_plan(), create_nestloop_plan(), create_resultscan_plan(), create_samplescan_plan(), create_seqscan_plan(), create_subqueryscan_plan(), create_tablefuncscan_plan(), create_tidrangescan_plan(), create_tidscan_plan(), create_valuesscan_plan(), create_worktablescan_plan(), and get_gating_quals().
|
static |
Definition at line 6239 of file createplan.c.
References Assert, copyObject, EquivalenceClass::ec_collation, EquivalenceClass::ec_has_volatile, EquivalenceClass::ec_members, EquivalenceClass::ec_sortref, elog, EquivalenceMember::em_datatype, EquivalenceMember::em_expr, ERROR, TargetEntry::expr, find_computable_ec_member(), find_ec_member_matching_expr(), get_opfamily_member(), get_sortgroupref_tle(), get_tle_by_resno(), i, inject_projection_plan(), InvalidOid, is_projection_capable_plan(), j, lappend(), lfirst, linitial, list_length(), makeTargetEntry(), OidIsValid, palloc(), Plan::parallel_safe, PathKey::pk_nulls_first, PathKey::pk_opfamily, PathKey::pk_strategy, TargetEntry::resno, and Plan::targetlist.
Referenced by create_append_plan(), create_gather_merge_plan(), create_merge_append_plan(), make_incrementalsort_from_pathkeys(), and make_sort_from_pathkeys().
|
static |
Definition at line 2353 of file createplan.c.
References Assert, i, lfirst, list_length(), palloc0(), root, and SortGroupClause::tleSortGroupRef.
Referenced by create_groupingsets_plan().
|
static |
Definition at line 4979 of file createplan.c.
References replace_nestloop_params_mutator(), and root.
Referenced by build_path_tlist(), create_append_plan(), create_bitmap_scan_plan(), create_ctescan_plan(), create_customscan_plan(), create_foreignscan_plan(), create_functionscan_plan(), create_hashjoin_plan(), create_indexscan_plan(), create_memoize_plan(), create_mergejoin_plan(), create_namedtuplestorescan_plan(), create_nestloop_plan(), create_resultscan_plan(), create_samplescan_plan(), create_seqscan_plan(), create_subqueryscan_plan(), create_tablefuncscan_plan(), create_tidrangescan_plan(), create_tidscan_plan(), create_valuesscan_plan(), create_worktablescan_plan(), and fix_indexqual_clause().
|
static |
Definition at line 4986 of file createplan.c.
References Assert, bms_is_member(), bms_is_subset(), expression_tree_mutator, find_placeholder_info(), IS_SPECIAL_VARNO, IsA, makeNode, PlaceHolderVar::phlevelsup, replace_nestloop_param_placeholdervar(), replace_nestloop_param_var(), root, Var::varlevelsup, and Var::varno.
Referenced by replace_nestloop_params().
|
static |
Definition at line 868 of file createplan.c.
References bms_add_member(), bms_is_empty, bms_is_member(), bms_is_subset(), bms_nonempty_difference(), CP_EXACT_TLIST, CP_LABEL_TLIST, CP_SMALL_TLIST, FirstLowInvalidHeapAttributeNumber, i, IsA, lfirst, RelOptInfo::min_attr, IndexOptInfo::ncolumns, NIL, Path::pathtype, PlaceHolderInfo::ph_eval_at, PlaceHolderInfo::ph_needed, RelOptInfo::relids, RELOPT_BASEREL, RelOptInfo::reloptkind, root, RTE_CTE, RTE_FUNCTION, RTE_RELATION, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, and RelOptInfo::rtekind.
Referenced by create_projection_plan(), and create_scan_plan().