|
PostgreSQL Source Code git master
|


Go to the source code of this file.
Typedefs | |
| typedef struct ExplainState | ExplainState |
| typedef PlannedStmt *(* | planner_hook_type) (Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams, ExplainState *es) |
| typedef void(* | planner_setup_hook_type) (PlannerGlobal *glob, Query *parse, const char *query_string, double *tuple_fraction, ExplainState *es) |
| typedef void(* | planner_shutdown_hook_type) (PlannerGlobal *glob, Query *parse, const char *query_string, PlannedStmt *pstmt) |
| typedef void(* | create_upper_paths_hook_type) (PlannerInfo *root, UpperRelationKind stage, RelOptInfo *input_rel, RelOptInfo *output_rel, void *extra) |
Functions | |
| PlannedStmt * | standard_planner (Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams, ExplainState *es) |
| PlannerInfo * | subquery_planner (PlannerGlobal *glob, Query *parse, char *plan_name, PlannerInfo *parent_root, bool hasRecursion, double tuple_fraction, SetOperationStmt *setops) |
| RowMarkType | select_rowmark_type (RangeTblEntry *rte, LockClauseStrength strength) |
| bool | limit_needed (Query *parse) |
| void | mark_partial_aggref (Aggref *agg, AggSplit aggsplit) |
| Path * | get_cheapest_fractional_path (RelOptInfo *rel, double tuple_fraction) |
| Expr * | preprocess_phv_expression (PlannerInfo *root, Expr *expr) |
| RelOptInfo * | create_unique_paths (PlannerInfo *root, RelOptInfo *rel, SpecialJoinInfo *sjinfo) |
| char * | choose_plan_name (PlannerGlobal *glob, const char *name, bool always_number) |
| typedef void(* create_upper_paths_hook_type) (PlannerInfo *root, UpperRelationKind stage, RelOptInfo *input_rel, RelOptInfo *output_rel, void *extra) |
| typedef struct ExplainState ExplainState |
| typedef PlannedStmt *(* planner_hook_type) (Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams, ExplainState *es) |
| typedef void(* planner_setup_hook_type) (PlannerGlobal *glob, Query *parse, const char *query_string, double *tuple_fraction, ExplainState *es) |
| typedef void(* planner_shutdown_hook_type) (PlannerGlobal *glob, Query *parse, const char *query_string, PlannedStmt *pstmt) |
| char * choose_plan_name | ( | PlannerGlobal * | glob, |
| const char * | name, | ||
| bool | always_number | ||
| ) |
Definition at line 8961 of file planner.c.
References foreach_ptr, lappend(), name, pfree(), psprintf(), and pstrdup().
Referenced by build_minmax_path(), make_subplan(), recurse_set_operations(), set_subquery_pathlist(), and SS_process_ctes().
| RelOptInfo * create_unique_paths | ( | PlannerInfo * | root, |
| RelOptInfo * | rel, | ||
| SpecialJoinInfo * | sjinfo | ||
| ) |
Definition at line 8409 of file planner.c.
References adjust_appendrel_attrs_multilevel(), Assert(), assignSortGroupRef(), bms_equal(), RelOptInfo::cheapest_parameterized_paths, RelOptInfo::cheapest_startup_path, RelOptInfo::cheapest_total_path, copy_pathtarget(), create_final_unique_paths(), create_partial_unique_paths(), create_pathtarget, elog, SortGroupClause::eqop, ERROR, PathTarget::exprs, forboth, get_compatible_hash_operators(), get_equality_op_for_ordering_op(), get_ordering_op_for_equality_op(), GetMemoryChunkContext(), IS_OTHER_REL, JOIN_SEMI, SpecialJoinInfo::jointype, lappend(), lfirst, lfirst_oid, list_delete_last(), list_length(), make_pathkeys_for_sortclauses(), make_tlist_from_pathtarget(), makeNode, makeTargetEntry(), MemoryContextSwitchTo(), NIL, SortGroupClause::nulls_first, OidIsValid, RelOptInfo::partial_pathlist, RelOptInfo::pathlist, RelOptInfo::ppilist, RelOptInfo::relids, RelOptInfo::reltarget, SortGroupClause::reverse_sort, root, SpecialJoinInfo::semi_can_btree, SpecialJoinInfo::semi_can_hash, SpecialJoinInfo::semi_operators, SpecialJoinInfo::semi_rhs_exprs, set_cheapest(), SortGroupClause::sortop, SpecialJoinInfo::syn_righthand, SortGroupClause::tleSortGroupRef, tlist_member(), RelOptInfo::unique_groupclause, RelOptInfo::unique_pathkeys, and RelOptInfo::unique_rel.
Referenced by join_is_legal(), and populate_joinrel_with_paths().
| Path * get_cheapest_fractional_path | ( | RelOptInfo * | rel, |
| double | tuple_fraction | ||
| ) |
Definition at line 6601 of file planner.c.
References RelOptInfo::cheapest_total_path, compare_fractional_path_costs(), lfirst, RelOptInfo::pathlist, and Path::rows.
Referenced by add_paths_to_append_rel(), make_subplan(), and standard_planner().
| bool limit_needed | ( | Query * | parse | ) |
Definition at line 2790 of file planner.c.
References DatumGetInt64(), IsA, and parse().
Referenced by grouping_planner(), and set_rel_consider_parallel().
Definition at line 5762 of file planner.c.
References AGGSPLIT_SIMPLE, Assert(), DO_AGGSPLIT_SERIALIZE, DO_AGGSPLIT_SKIPFINAL, and OidIsValid.
Referenced by convert_combining_aggrefs(), create_rel_agg_info(), and make_partial_grouping_target().
| Expr * preprocess_phv_expression | ( | PlannerInfo * | root, |
| Expr * | expr | ||
| ) |
Definition at line 1431 of file planner.c.
References EXPRKIND_PHV, preprocess_expression(), and root.
Referenced by extract_lateral_references().
| RowMarkType select_rowmark_type | ( | RangeTblEntry * | rte, |
| LockClauseStrength | strength | ||
| ) |
Definition at line 2539 of file planner.c.
References elog, ERROR, GetFdwRoutineByRelId(), FdwRoutine::GetForeignRowMarkType, LCS_FORKEYSHARE, LCS_FORNOKEYUPDATE, LCS_FORSHARE, LCS_FORUPDATE, LCS_NONE, ROW_MARK_COPY, ROW_MARK_EXCLUSIVE, ROW_MARK_KEYSHARE, ROW_MARK_NOKEYEXCLUSIVE, ROW_MARK_REFERENCE, ROW_MARK_SHARE, RTE_RELATION, and RangeTblEntry::rtekind.
Referenced by expand_single_inheritance_child(), and preprocess_rowmarks().
| PlannedStmt * standard_planner | ( | Query * | parse, |
| const char * | query_string, | ||
| int | cursorOptions, | ||
| ParamListInfo | boundParams, | ||
| ExplainState * | es | ||
| ) |
Definition at line 333 of file planner.c.
References PlannerGlobal::allRelids, PlannerGlobal::appendRelations, PlannedStmt::appendRelations, Assert(), bms_difference(), PlannedStmt::canSetTag, CMD_SELECT, PlannedStmt::commandType, create_plan(), CURSOR_OPT_FAST_PLAN, CURSOR_OPT_PARALLEL_OK, CURSOR_OPT_SCROLL, cursor_tuple_fraction, DEBUG_PARALLEL_OFF, debug_parallel_query, DEBUG_PARALLEL_REGRESS, PlannerGlobal::dependsOnRole, PlannedStmt::dependsOnRole, DestroyPartitionDirectory(), ExecSupportsBackwardScan(), fetch_upper_rel(), PlannerGlobal::finalrowmarks, PlannerGlobal::finalrtable, PlannerGlobal::finalrteperminfos, forboth, get_cheapest_fractional_path(), PlannedStmt::hasModifyingCTE, PlannedStmt::hasReturning, Plan::initPlan, PlannerGlobal::invalItems, PlannedStmt::invalItems, Gather::invisible, IsParallelWorker, IsUnderPostmaster, jit_above_cost, jit_enabled, jit_expressions, jit_inline_above_cost, jit_optimize_above_cost, jit_tuple_deforming, PlannedStmt::jitFlags, PlannerGlobal::lastPHId, PlannerGlobal::lastPlanNodeId, PlannerGlobal::lastRowMarkId, Plan::lefttree, lfirst, lfirst_node, list_length(), makeNode, materialize_finished_plan(), max_parallel_hazard(), max_parallel_workers_per_gather, PlannerGlobal::maxParallelHazard, NIL, Gather::num_workers, Plan::parallel_aware, Plan::parallel_safe, parallel_setup_cost, parallel_tuple_cost, PlannerGlobal::parallelModeNeeded, PlannedStmt::parallelModeNeeded, PlannerGlobal::parallelModeOK, PlannerGlobal::paramExecTypes, PlannedStmt::paramExecTypes, parse(), PlannerGlobal::partPruneInfos, PlannedStmt::partPruneInfos, PlannedStmt::permInfos, PGJIT_DEFORM, PGJIT_EXPR, PGJIT_INLINE, PGJIT_NONE, PGJIT_OPT3, PGJIT_PERFORM, Gather::plan, Plan::plan_rows, PLAN_STMT_STANDARD, Plan::plan_width, planner_setup_hook, planner_shutdown_hook, PlannedStmt::planOrigin, PlannedStmt::planTree, PlannerGlobal::prunableRelids, Plan::qual, PlannedStmt::queryId, PlannerGlobal::relationOids, PlannedStmt::relationOids, Gather::rescan_param, PlannerGlobal::resultRelations, PlannedStmt::resultRelations, PlannerGlobal::rewindPlanIDs, PlannedStmt::rewindPlanIDs, Plan::righttree, root, PlannedStmt::rowMarks, PlannedStmt::rtable, set_plan_references(), Gather::single_copy, SS_compute_initplan_cost(), SS_finalize_plan(), Plan::startup_cost, PlannedStmt::stmt_len, PlannedStmt::stmt_location, PlannerGlobal::subpaths, PlannerGlobal::subplans, PlannedStmt::subplans, subquery_planner(), Plan::targetlist, Plan::total_cost, PlannerGlobal::transientPlan, PlannedStmt::transientPlan, PlannedStmt::unprunableRelids, UPPERREL_FINAL, and PlannedStmt::utilityStmt.
Referenced by delay_execution_planner(), pgss_planner(), and planner().
| PlannerInfo * subquery_planner | ( | PlannerGlobal * | glob, |
| Query * | parse, | ||
| char * | plan_name, | ||
| PlannerInfo * | parent_root, | ||
| bool | hasRecursion, | ||
| double | tuple_fraction, | ||
| SetOperationStmt * | setops | ||
| ) |
Definition at line 693 of file planner.c.
References aclcheck_error(), ACLCHECK_NO_PRIV, generate_unaccent_rules::action, Assert(), assign_special_exec_param(), bms_is_member(), bms_make_singleton(), contain_agg_clause(), contain_subplans(), contain_volatile_functions(), copyObject, CurrentMemoryContext, WindowClause::endOffset, ExecCheckOneRelPerms(), expand_grouping_sets(), expression_returns_set(), EXPRKIND_APPINFO, EXPRKIND_ARBITER_ELEM, EXPRKIND_GROUPEXPR, EXPRKIND_LIMIT, EXPRKIND_QUAL, EXPRKIND_RTFUNC, EXPRKIND_RTFUNC_LATERAL, EXPRKIND_TABLEFUNC, EXPRKIND_TABLEFUNC_LATERAL, EXPRKIND_TABLESAMPLE, EXPRKIND_TARGET, EXPRKIND_VALUES, EXPRKIND_VALUES_LATERAL, fetch_upper_rel(), flatten_group_exprs(), flatten_join_alias_vars(), flatten_simple_union_all(), RangeTblEntry::functions, get_rel_name(), getRTEPermissionInfo(), grouping_planner(), RangeTblEntry::inh, IS_OUTER_JOIN, RangeTblEntry::jointype, lappend(), lfirst, lfirst_node, linitial, list_cell_number(), list_concat(), list_length(), list_make1, makeNode, Max, NIL, OBJECT_VIEW, parse(), preprocess_expression(), preprocess_function_rtes(), preprocess_qual_conditions(), preprocess_relation_rtes(), preprocess_rowmarks(), pull_up_sublinks(), pull_up_subqueries(), pull_varnos(), WithCheckOption::qual, PlannerInfo::query_level, reduce_outer_joins(), RTEPermissionInfo::relid, remove_useless_result_rtes(), replace_empty_jointree(), root, rt_fetch, RTE_FUNCTION, RTE_GROUP, RTE_JOIN, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, set_cheapest(), SS_charge_for_initplans(), SS_identify_outer_params(), SS_process_ctes(), WindowClause::startOffset, RangeTblEntry::subquery, RangeTblEntry::tablefunc, RangeTblEntry::tablesample, transform_MERGE_to_join(), UPPERREL_FINAL, and RangeTblEntry::values_lists.
Referenced by make_subplan(), recurse_set_operations(), set_subquery_pathlist(), SS_process_ctes(), and standard_planner().
|
extern |
Definition at line 83 of file planner.c.
Referenced by create_distinct_paths(), create_ordered_paths(), create_ordinary_grouping_paths(), create_partial_distinct_paths(), create_window_paths(), grouping_planner(), and postprocess_setop_rel().
|
extern |
Definition at line 74 of file planner.c.
Referenced by _PG_init(), and planner().
|
extern |
Definition at line 77 of file planner.c.
Referenced by standard_planner().
|
extern |
Definition at line 80 of file planner.c.
Referenced by standard_planner().