PostgreSQL Source Code git master
|
Go to the source code of this file.
Functions | |
void | SS_process_ctes (PlannerInfo *root) |
JoinExpr * | convert_ANY_sublink_to_join (PlannerInfo *root, SubLink *sublink, Relids available_rels) |
JoinExpr * | convert_EXISTS_sublink_to_join (PlannerInfo *root, SubLink *sublink, bool under_not, Relids available_rels) |
Node * | SS_replace_correlation_vars (PlannerInfo *root, Node *expr) |
Node * | SS_process_sublinks (PlannerInfo *root, Node *expr, bool isQual) |
void | SS_identify_outer_params (PlannerInfo *root) |
void | SS_charge_for_initplans (PlannerInfo *root, RelOptInfo *final_rel) |
void | SS_compute_initplan_cost (List *init_plans, Cost *initplan_cost_p, bool *unsafe_initplans_p) |
void | SS_attach_initplans (PlannerInfo *root, Plan *plan) |
void | SS_finalize_plan (PlannerInfo *root, Plan *plan) |
Param * | SS_make_initplan_output_param (PlannerInfo *root, Oid resulttype, int32 resulttypmod, Oid resultcollation) |
void | SS_make_initplan_from_plan (PlannerInfo *root, PlannerInfo *subroot, Plan *plan, Param *prm) |
JoinExpr * convert_ANY_sublink_to_join | ( | PlannerInfo * | root, |
SubLink * | sublink, | ||
Relids | available_rels | ||
) |
Definition at line 1251 of file subselect.c.
References addRangeTableEntryForSubquery(), ANY_SUBLINK, Assert, bms_is_empty, bms_is_subset(), contain_volatile_functions(), convert_testexpr(), generate_subquery_vars(), JoinExpr::isNatural, JOIN_SEMI, JoinExpr::jointype, lappend(), JoinExpr::larg, list_length(), make_parsestate(), makeAlias(), makeNode, NIL, parse(), pull_varnos(), pull_varnos_of_level(), JoinExpr::quals, JoinExpr::rarg, root, JoinExpr::rtindex, SubLink::subLinkType, SubLink::subselect, Query::targetList, and SubLink::testexpr.
Referenced by pull_up_sublinks_qual_recurse().
JoinExpr * convert_EXISTS_sublink_to_join | ( | PlannerInfo * | root, |
SubLink * | sublink, | ||
bool | under_not, | ||
Relids | available_rels | ||
) |
Definition at line 1368 of file subselect.c.
References Assert, bms_add_member(), bms_free(), bms_is_empty, bms_is_subset(), bms_next_member(), CombineRangeTables(), contain_vars_of_level(), contain_volatile_functions(), copyObject, Query::cteList, EXISTS_SUBLINK, FromExpr::fromlist, IncrementVarSublevelsUp(), JoinExpr::isNatural, JOIN_ANTI, JOIN_SEMI, Query::jointree, JoinExpr::jointype, JoinExpr::larg, linitial, list_length(), makeNode, NIL, OffsetVarNodes(), parse(), pull_varnos(), JoinExpr::quals, FromExpr::quals, JoinExpr::rarg, replace_empty_jointree(), root, Query::rtable, JoinExpr::rtindex, simplify_EXISTS_query(), SubLink::subLinkType, and SubLink::subselect.
Referenced by pull_up_sublinks_qual_recurse().
void SS_attach_initplans | ( | PlannerInfo * | root, |
Plan * | plan | ||
) |
Definition at line 2258 of file subselect.c.
Referenced by create_plan().
void SS_charge_for_initplans | ( | PlannerInfo * | root, |
RelOptInfo * | final_rel | ||
) |
Definition at line 2153 of file subselect.c.
References RelOptInfo::consider_parallel, lfirst, NIL, Path::parallel_safe, RelOptInfo::partial_pathlist, RelOptInfo::pathlist, root, SS_compute_initplan_cost(), Path::startup_cost, and Path::total_cost.
Referenced by build_minmax_path(), and subquery_planner().
void SS_compute_initplan_cost | ( | List * | init_plans, |
Cost * | initplan_cost_p, | ||
bool * | unsafe_initplans_p | ||
) |
Definition at line 2217 of file subselect.c.
References lfirst_node, SubPlan::parallel_safe, SubPlan::per_call_cost, and SubPlan::startup_cost.
Referenced by clean_up_removed_plan_level(), materialize_finished_plan(), SS_charge_for_initplans(), and standard_planner().
void SS_finalize_plan | ( | PlannerInfo * | root, |
Plan * | plan | ||
) |
Definition at line 2273 of file subselect.c.
References finalize_plan(), plan, and root.
Referenced by standard_planner().
void SS_identify_outer_params | ( | PlannerInfo * | root | ) |
Definition at line 2091 of file subselect.c.
References bms_add_member(), PlannerInfo::init_plans, lfirst, lfirst_int, NIL, PlannerParamItem::paramId, PlannerInfo::plan_params, root, SubPlan::setParam, and PlannerInfo::wt_param_id.
Referenced by build_minmax_path(), and subquery_planner().
void SS_make_initplan_from_plan | ( | PlannerInfo * | root, |
PlannerInfo * | subroot, | ||
Plan * | plan, | ||
Param * | prm | ||
) |
Definition at line 3034 of file subselect.c.
References cost_subplan(), EXPR_SUBLINK, SubPlan::firstColCollation, SubPlan::firstColType, SubPlan::firstColTypmod, get_first_col_type(), lappend(), list_length(), list_make1_int, makeNode, SubPlan::parallel_safe, Param::paramid, plan, SubPlan::plan_id, SubPlan::plan_name, psprintf(), root, SubPlan::setParam, and SubPlan::subLinkType.
Referenced by create_minmaxagg_plan().
Param * SS_make_initplan_output_param | ( | PlannerInfo * | root, |
Oid | resulttype, | ||
int32 | resulttypmod, | ||
Oid | resultcollation | ||
) |
Definition at line 3018 of file subselect.c.
References generate_new_exec_param(), and root.
Referenced by preprocess_minmax_aggregates().
void SS_process_ctes | ( | PlannerInfo * | root | ) |
Definition at line 878 of file subselect.c.
References Assert, assign_special_exec_param(), RelOptInfo::cheapest_total_path, CMD_SELECT, contain_dml(), contain_outer_selfref(), contain_volatile_functions(), copyObject, cost_subplan(), create_plan(), CTE_SUBLINK, CommonTableExpr::ctematerialized, CTEMaterializeDefault, CTEMaterializeNever, CommonTableExpr::ctename, CommonTableExpr::ctequery, elog, ERROR, fetch_upper_rel(), get_first_col_type(), inline_cte(), lappend(), lappend_int(), lfirst, list_length(), list_make1_int, makeNode, NIL, plan, psprintf(), root, splan, subquery_planner(), and UPPERREL_FINAL.
Referenced by subquery_planner().
Node * SS_process_sublinks | ( | PlannerInfo * | root, |
Node * | expr, | ||
bool | isQual | ||
) |
Definition at line 1938 of file subselect.c.
References process_sublinks_context::isTopQual, process_sublinks_mutator(), process_sublinks_context::root, and root.
Referenced by build_subplan(), and preprocess_expression().
Node * SS_replace_correlation_vars | ( | PlannerInfo * | root, |
Node * | expr | ||
) |
Definition at line 1889 of file subselect.c.
References replace_correlation_vars_mutator(), and root.
Referenced by preprocess_expression().