PostgreSQL Source Code
git master
|
Go to the source code of this file.
Functions | |
void | transform_MERGE_to_join (Query *parse) |
void | replace_empty_jointree (Query *parse) |
void | pull_up_sublinks (PlannerInfo *root) |
void | preprocess_function_rtes (PlannerInfo *root) |
void | pull_up_subqueries (PlannerInfo *root) |
void | flatten_simple_union_all (PlannerInfo *root) |
void | reduce_outer_joins (PlannerInfo *root) |
void | remove_useless_result_rtes (PlannerInfo *root) |
Relids | get_relids_in_jointree (Node *jtnode, bool include_outer_joins, bool include_inner_joins) |
Relids | get_relids_for_join (Query *query, int joinrelid) |
void | preprocess_targetlist (PlannerInfo *root) |
List * | extract_update_targetlist_colnos (List *tlist) |
PlanRowMark * | get_plan_rowmark (List *rowmarks, Index rtindex) |
void | get_agg_clause_costs (PlannerInfo *root, AggSplit aggsplit, AggClauseCosts *costs) |
void | preprocess_aggrefs (PlannerInfo *root, Node *clause) |
RelOptInfo * | plan_set_operations (PlannerInfo *root) |
bool | set_operation_ordered_results_useful (SetOperationStmt *setop) |
Definition at line 345 of file preptlist.c.
References lappend_int(), lfirst, NIL, and TargetEntry::resno.
Referenced by make_modifytable(), and preprocess_targetlist().
void flatten_simple_union_all | ( | PlannerInfo * | root | ) |
Definition at line 2815 of file prepjointree.c.
References Assert, castNode, copyObject, RangeTblEntry::inh, is_simple_union_all_recurse(), IsA, lappend(), SetOperationStmt::larg, list_length(), list_make1, makeNode, NIL, parse(), pull_up_union_leaf_queries(), root, rt_fetch, RTE_SUBQUERY, RangeTblEntry::rtekind, and RangeTblRef::rtindex.
Referenced by subquery_planner().
void get_agg_clause_costs | ( | PlannerInfo * | root, |
AggSplit | aggsplit, | ||
AggClauseCosts * | costs | ||
) |
Definition at line 559 of file prepagg.c.
References add_function_cost(), Aggref::aggdirectargs, AggTransInfo::aggfilter, AggInfo::aggrefs, AggTransInfo::aggtransspace, AggTransInfo::aggtranstype, AggTransInfo::aggtranstypmod, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_SMALL_INITSIZE, AggTransInfo::args, AggTransInfo::combinefn_oid, cost_qual_eval_node(), AggTransInfo::deserialfn_oid, DO_AGGSPLIT_COMBINE, DO_AGGSPLIT_DESERIALIZE, DO_AGGSPLIT_SERIALIZE, DO_AGGSPLIT_SKIPFINAL, AggClauseCosts::finalCost, AggInfo::finalfn_oid, get_typavgwidth(), lfirst_node, linitial_node, MAXALIGN, OidIsValid, QualCost::per_tuple, root, AggTransInfo::serialfn_oid, QualCost::startup, AggClauseCosts::transCost, AggTransInfo::transfn_oid, AggClauseCosts::transitionSpace, and AggTransInfo::transtypeByVal.
Referenced by create_grouping_paths(), create_partial_grouping_paths(), and estimate_path_cost_size().
PlanRowMark* get_plan_rowmark | ( | List * | rowmarks, |
Index | rtindex | ||
) |
Definition at line 509 of file preptlist.c.
References lfirst, and PlanRowMark::rti.
Referenced by check_index_predicates(), deparseLockingClause(), and expand_inherited_rtentry().
Definition at line 4135 of file prepjointree.c.
References elog, ERROR, find_jointree_node_for_rel(), get_relids_in_jointree(), and Query::jointree.
Referenced by add_nullingrels_if_needed(), and alias_relid_set().
Definition at line 4074 of file prepjointree.c.
References bms_add_member(), bms_join(), bms_make_singleton(), elog, ERROR, FromExpr::fromlist, IsA, j, JOIN_INNER, lfirst, and nodeTag.
Referenced by find_dependent_phvs_in_jointree(), get_relids_for_join(), is_simple_subquery(), mark_nullable_by_grouping(), preprocess_rowmarks(), pull_up_simple_subquery(), and remove_result_refs().
RelOptInfo* plan_set_operations | ( | PlannerInfo * | root | ) |
Definition at line 99 of file prepunion.c.
References Assert, castNode, generate_recursion_path(), IsA, SetOperationStmt::larg, NIL, parse(), recurse_set_operations(), root, setup_simple_rel_arrays(), RangeTblEntry::subquery, and Query::targetList.
Referenced by grouping_planner().
void preprocess_aggrefs | ( | PlannerInfo * | root, |
Node * | clause | ||
) |
Definition at line 110 of file prepagg.c.
References preprocess_aggrefs_walker(), and root.
Referenced by grouping_planner().
void preprocess_function_rtes | ( | PlannerInfo * | root | ) |
Definition at line 887 of file prepjointree.c.
References eval_const_expressions(), RangeTblEntry::funcordinality, RangeTblEntry::functions, inline_set_returning_function(), lfirst, NIL, root, RTE_FUNCTION, RTE_SUBQUERY, RangeTblEntry::rtekind, and RangeTblEntry::subquery.
Referenced by pull_up_simple_subquery(), and subquery_planner().
void preprocess_targetlist | ( | PlannerInfo * | root | ) |
Definition at line 62 of file preptlist.c.
References generate_unaccent_rules::action, add_row_identity_columns(), PlanRowMark::allMarkTypes, Assert, CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_SELECT, CMD_UPDATE, elog, ERROR, expand_insert_targetlist(), extract_update_targetlist_colnos(), RangeTblEntry::inh, InvalidOid, IsA, PlanRowMark::isParent, lappend(), lfirst, list_concat_copy(), list_free(), list_length(), makeTargetEntry(), makeVar(), makeWholeRowVar(), NoLock, parse(), PlanRowMark::prti, pstrdup(), pull_var_clause(), PVC_INCLUDE_PLACEHOLDERS, PVC_RECURSE_AGGREGATES, PVC_RECURSE_WINDOWFUNCS, RangeTblEntry::relid, root, ROW_MARK_COPY, PlanRowMark::rowmarkId, rt_fetch, RTE_RELATION, RangeTblEntry::rtekind, PlanRowMark::rti, SelfItemPointerAttributeNumber, snprintf, table_close(), table_open(), TableOidAttributeNumber, tlist_member(), and Var::varno.
Referenced by grouping_planner().
void pull_up_sublinks | ( | PlannerInfo * | root | ) |
Definition at line 453 of file prepjointree.c.
References IsA, list_make1, makeFromExpr(), pull_up_sublinks_jointree_recurse(), and root.
Referenced by pull_up_simple_subquery(), and subquery_planner().
void pull_up_subqueries | ( | PlannerInfo * | root | ) |
Definition at line 928 of file prepjointree.c.
References Assert, IsA, pull_up_subqueries_recurse(), and root.
Referenced by pull_up_simple_subquery(), and subquery_planner().
void reduce_outer_joins | ( | PlannerInfo * | root | ) |
Definition at line 2934 of file prepjointree.c.
References bms_is_empty, bms_make_singleton(), reduce_outer_joins_pass1_state::contains_outer, elog, ERROR, reduce_outer_joins_partial_state::full_join_rti, reduce_outer_joins_pass2_state::inner_reduced, lfirst, NIL, reduce_outer_joins_pass2_state::partial_reduced, reduce_outer_joins_pass1(), reduce_outer_joins_pass2(), remove_nulling_relids(), root, and reduce_outer_joins_partial_state::unreduced_side.
Referenced by subquery_planner().
void remove_useless_result_rtes | ( | PlannerInfo * | root | ) |
Definition at line 3428 of file prepjointree.c.
References Assert, bms_is_empty, foreach_delete_current, IsA, lfirst, remove_nulling_relids(), remove_useless_results_recurse(), root, rt_fetch, RTE_RESULT, and PlanRowMark::rti.
Referenced by subquery_planner().
void replace_empty_jointree | ( | Query * | parse | ) |
Definition at line 395 of file prepjointree.c.
References lappend(), list_length(), list_make1, makeAlias(), makeNode, NIL, parse(), RTE_RESULT, RangeTblEntry::rtekind, and RangeTblRef::rtindex.
Referenced by convert_EXISTS_sublink_to_join(), pull_up_simple_subquery(), and subquery_planner().
bool set_operation_ordered_results_useful | ( | SetOperationStmt * | setop | ) |
Definition at line 188 of file prepunion.c.
References SetOperationStmt::all, SetOperationStmt::op, and SETOP_UNION.
Referenced by standard_qp_callback().
void transform_MERGE_to_join | ( | Query * | parse | ) |
Definition at line 168 of file prepjointree.c.
References generate_unaccent_rules::action, add_nulling_relids(), NullTest::arg, Assert, bms_make_singleton(), CMD_MERGE, CMD_NOTHING, elog, ERROR, foreach_node, RangeTblEntry::inh, IS_NOT_NULL, IsA, JoinExpr::isNatural, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, RangeTblEntry::jointype, JoinExpr::jointype, lappend(), JoinExpr::larg, linitial, list_length(), list_make1, NullTest::location, make_and_qual(), makeAlias(), makeFromExpr(), makeNode, makeWholeRowVar(), MERGE_WHEN_MATCHED, MERGE_WHEN_NOT_MATCHED_BY_SOURCE, MERGE_WHEN_NOT_MATCHED_BY_TARGET, NIL, nodeTag, NullTest::nulltesttype, NUM_MERGE_MATCH_KINDS, parse(), JoinExpr::quals, JoinExpr::rarg, rt_fetch, RTE_JOIN, RangeTblEntry::rtekind, RangeTblRef::rtindex, JoinExpr::rtindex, and source.
Referenced by subquery_planner().