PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/cost.h"
#include "optimizer/optimizer.h"
#include "optimizer/tlist.h"
Go to the source code of this file.
Data Structures | |
struct | split_pathtarget_item |
struct | split_pathtarget_context |
void add_column_to_pathtarget | ( | PathTarget * | target, |
Expr * | expr, | ||
Index | sortgroupref | ||
) |
Definition at line 684 of file tlist.c.
References PathTarget::exprs, PathTarget::has_volatile_expr, lappend(), list_length(), palloc0(), repalloc(), PathTarget::sortgrouprefs, VOLATILITY_NOVOLATILE, and VOLATILITY_UNKNOWN.
Referenced by add_new_column_to_pathtarget(), add_sp_item_to_pathtarget(), create_one_window_path(), make_group_input_target(), make_partial_grouping_target(), make_sort_input_target(), and make_window_input_target().
void add_new_column_to_pathtarget | ( | PathTarget * | target, |
Expr * | expr | ||
) |
Definition at line 730 of file tlist.c.
References add_column_to_pathtarget(), PathTarget::exprs, and list_member().
Referenced by add_new_columns_to_pathtarget().
void add_new_columns_to_pathtarget | ( | PathTarget * | target, |
List * | exprs | ||
) |
Definition at line 741 of file tlist.c.
References add_new_column_to_pathtarget(), and lfirst.
Referenced by make_group_input_target(), make_partial_grouping_target(), make_sort_input_target(), and make_window_input_target().
|
static |
Definition at line 1191 of file tlist.c.
References add_column_to_pathtarget(), copyObject, equal(), split_pathtarget_item::expr, PathTarget::exprs, get_pathtarget_sortgroupref, lfirst, list_length(), palloc0(), split_pathtarget_item::sortgroupref, and PathTarget::sortgrouprefs.
Referenced by add_sp_items_to_pathtarget(), and split_pathtarget_at_srfs().
|
static |
Definition at line 1237 of file tlist.c.
References add_sp_item_to_pathtarget(), and lfirst.
Referenced by split_pathtarget_at_srfs().
Definition at line 121 of file tlist.c.
References copyObject, lappend(), lfirst, list_length(), makeTargetEntry(), and tlist_member().
Referenced by build_tlist_to_deparse(), and foreign_grouping_ok().
void apply_pathtarget_labeling_to_tlist | ( | List * | tlist, |
PathTarget * | target | ||
) |
Definition at line 763 of file tlist.c.
References elog(), ERROR, PathTarget::exprs, i, IsA, lfirst, TargetEntry::ressortgroupref, PathTarget::sortgrouprefs, tlist_member(), and tlist_member_match_var().
Referenced by create_projection_plan(), and create_scan_plan().
Definition at line 307 of file tlist.c.
References Assert(), forboth, lfirst, list_length(), TargetEntry::resjunk, TargetEntry::resname, TargetEntry::resno, TargetEntry::resorigcol, TargetEntry::resorigtbl, and TargetEntry::ressortgroupref.
Referenced by clean_up_removed_plan_level(), create_modifytable_plan(), and create_plan().
PathTarget* copy_pathtarget | ( | PathTarget * | src | ) |
Definition at line 646 of file tlist.c.
References PathTarget::exprs, list_copy(), list_length(), makeNode, palloc(), and PathTarget::sortgrouprefs.
Referenced by apply_scanjoin_target_to_paths(), create_one_window_path(), create_partitionwise_grouping_paths(), and reparameterize_path_by_child().
int count_nonjunk_tlist_entries | ( | List * | tlist | ) |
Definition at line 175 of file tlist.c.
References len, lfirst, and TargetEntry::resjunk.
Referenced by get_update_query_targetlist_def(), transformJsonArrayQueryConstructor(), transformMultiAssignRef(), and transformSubLink().
PathTarget* create_empty_pathtarget | ( | void | ) |
Definition at line 670 of file tlist.c.
References makeNode.
Referenced by build_child_join_rel(), build_join_rel(), build_simple_rel(), fetch_upper_rel(), make_group_input_target(), make_partial_grouping_target(), make_sort_input_target(), make_window_input_target(), and split_pathtarget_at_srfs().
Definition at line 478 of file tlist.c.
References TargetEntry::expr, exprCollation(), get_sortgroupclause_tle(), lfirst, list_length(), and palloc().
Referenced by create_agg_plan(), create_group_plan(), and create_groupingsets_plan().
AttrNumber* extract_grouping_cols | ( | List * | groupClause, |
List * | tlist | ||
) |
Definition at line 503 of file tlist.c.
References get_sortgroupclause_tle(), lfirst, list_length(), palloc(), and TargetEntry::resno.
Referenced by create_agg_plan(), and create_group_plan().
Definition at line 452 of file tlist.c.
References Assert(), SortGroupClause::eqop, lfirst, list_length(), OidIsValid, and palloc().
Referenced by create_agg_plan(), create_group_plan(), and create_groupingsets_plan().
Node* get_sortgroupclause_expr | ( | SortGroupClause * | sgClause, |
List * | targetList | ||
) |
Definition at line 368 of file tlist.c.
References TargetEntry::expr, and get_sortgroupclause_tle().
Referenced by get_sortgrouplist_exprs(), make_pathkeys_for_sortclauses(), transformAggregateCall(), and transformWindowDefinitions().
TargetEntry* get_sortgroupclause_tle | ( | SortGroupClause * | sgClause, |
List * | targetList | ||
) |
Definition at line 356 of file tlist.c.
References get_sortgroupref_tle(), and SortGroupClause::tleSortGroupRef.
Referenced by build_pertrans_for_aggref(), create_groupingsets_plan(), create_limit_plan(), create_windowagg_plan(), extract_grouping_collations(), extract_grouping_cols(), get_sortgroupclause_expr(), make_recursive_union(), make_setop(), make_sort_from_sortclauses(), make_unique_from_sortclauses(), ordered_set_startup(), parseCheckAggregates(), query_is_distinct_for(), remove_useless_groupby_columns(), and transformDistinctClause().
Definition at line 381 of file tlist.c.
References get_sortgroupclause_expr(), lappend(), lfirst, and NIL.
Referenced by create_final_distinct_paths(), create_partial_distinct_paths(), estimate_path_cost_size(), get_number_of_groups(), and group_by_has_partkey().
SortGroupClause* get_sortgroupref_clause | ( | Index | sortref, |
List * | clauses | ||
) |
Definition at line 411 of file tlist.c.
References elog(), ERROR, lfirst, and SortGroupClause::tleSortGroupRef.
Referenced by get_cheapest_group_keys_order(), group_keys_reorder_by_pathkeys(), and preprocess_groupclause().
SortGroupClause* get_sortgroupref_clause_noerr | ( | Index | sortref, |
List * | clauses | ||
) |
Definition at line 432 of file tlist.c.
References lfirst, and SortGroupClause::tleSortGroupRef.
Referenced by find_em_for_rel_target(), foreign_grouping_ok(), make_group_input_target(), and make_partial_grouping_target().
TargetEntry* get_sortgroupref_tle | ( | Index | sortref, |
List * | targetList | ||
) |
Definition at line 334 of file tlist.c.
References elog(), ERROR, lfirst, and TargetEntry::ressortgroupref.
Referenced by convert_subquery_pathkeys(), deparseSortGroupClause(), foreign_expr_walker(), get_rule_sortgroupclause(), get_sortgroupclause_tle(), make_unique_from_pathkeys(), prepare_sort_from_pathkeys(), and transformDistinctOnClause().
Definition at line 152 of file tlist.c.
References TargetEntry::expr, lappend(), lfirst, NIL, and TargetEntry::resjunk.
Referenced by recurse_set_operations().
Definition at line 549 of file tlist.c.
References SortGroupClause::hashable, and lfirst.
Referenced by choose_hashed_setop(), create_final_distinct_paths(), create_grouping_paths(), create_partial_distinct_paths(), and generate_recursion_path().
Definition at line 529 of file tlist.c.
References lfirst, OidIsValid, and SortGroupClause::sortop.
Referenced by adjust_foreign_grouping_path_cost(), choose_hashed_setop(), create_final_distinct_paths(), create_grouping_paths(), create_partial_distinct_paths(), make_pathkeys_for_window(), and standard_qp_callback().
PathTarget* make_pathtarget_from_tlist | ( | List * | tlist | ) |
Definition at line 580 of file tlist.c.
References TargetEntry::expr, PathTarget::exprs, PathTarget::has_volatile_expr, i, lappend(), lfirst, list_length(), makeNode, palloc(), TargetEntry::ressortgroupref, PathTarget::sortgrouprefs, and VOLATILITY_UNKNOWN.
List* make_tlist_from_pathtarget | ( | PathTarget * | target | ) |
Definition at line 613 of file tlist.c.
References PathTarget::exprs, i, lappend(), lfirst, makeTargetEntry(), NIL, TargetEntry::ressortgroupref, and PathTarget::sortgrouprefs.
Referenced by set_subquery_pathlist().
void split_pathtarget_at_srfs | ( | PlannerInfo * | root, |
PathTarget * | target, | ||
PathTarget * | input_target, | ||
List ** | targets, | ||
List ** | targets_contain_srfs | ||
) |
Definition at line 870 of file tlist.c.
References add_sp_item_to_pathtarget(), add_sp_items_to_pathtarget(), create_empty_pathtarget(), split_pathtarget_context::current_depth, split_pathtarget_context::current_input_srfs, split_pathtarget_context::current_input_vars, split_pathtarget_context::current_sgref, split_pathtarget_item::expr, PathTarget::exprs, for_each_cell, forthree, get_pathtarget_sortgroupref, split_pathtarget_context::input_target_exprs, IS_SRF_CALL, lappend(), lappend_int(), split_pathtarget_context::level_input_srfs, split_pathtarget_context::level_input_vars, split_pathtarget_context::level_srfs, lfirst, list_concat(), list_make1, list_make1_int, list_member(), list_nth_cell(), lnext(), NIL, set_pathtarget_cost_width(), and split_pathtarget_walker().
Referenced by grouping_planner().
|
static |
Definition at line 1066 of file tlist.c.
References split_pathtarget_context::current_depth, split_pathtarget_context::current_input_srfs, split_pathtarget_context::current_input_vars, split_pathtarget_context::current_sgref, split_pathtarget_item::expr, expression_tree_walker(), split_pathtarget_context::input_target_exprs, IS_SRF_CALL, IsA, lappend(), split_pathtarget_context::level_input_srfs, split_pathtarget_context::level_input_vars, split_pathtarget_context::level_srfs, lfirst, list_concat(), list_length(), list_member(), list_nth_cell(), Max, NIL, palloc(), and split_pathtarget_item::sortgroupref.
Referenced by split_pathtarget_at_srfs().
TargetEntry* tlist_member | ( | Expr * | node, |
List * | targetlist | ||
) |
Definition at line 68 of file tlist.c.
References equal(), TargetEntry::expr, and lfirst.
Referenced by add_to_flat_tlist(), apply_pathtarget_labeling_to_tlist(), build_remote_returning(), create_unique_plan(), preprocess_targetlist(), rebuild_fdw_scan_tlist(), and search_indexed_tlist_for_non_var().
|
static |
Definition at line 91 of file tlist.c.
References TargetEntry::expr, if(), IsA, lfirst, Var::varattno, Var::varlevelsup, Var::varno, and Var::vartype.
Referenced by apply_pathtarget_labeling_to_tlist().
Definition at line 271 of file tlist.c.
References TargetEntry::expr, exprCollation(), lfirst, lfirst_oid, list_head(), lnext(), and TargetEntry::resjunk.
Referenced by recurse_set_operations().
Definition at line 237 of file tlist.c.
References TargetEntry::expr, exprType(), lfirst, lfirst_oid, list_head(), lnext(), and TargetEntry::resjunk.
Referenced by is_simple_union_all_recurse(), and recurse_set_operations().
Definition at line 207 of file tlist.c.
References equal(), TargetEntry::expr, forboth, lfirst, and list_length().
Referenced by apply_scanjoin_target_to_paths(), change_plan_targetlist(), and create_projection_plan().