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 |
Macros | |
#define | IS_SRF_CALL(node) |
#define IS_SRF_CALL | ( | node | ) |
void add_column_to_pathtarget | ( | PathTarget * | target, |
Expr * | expr, | ||
Index | sortgroupref | ||
) |
Definition at line 695 of file tlist.c.
References PathTarget::exprs, PathTarget::has_volatile_expr, lappend(), list_length(), palloc0(), repalloc(), 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 741 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 752 of file tlist.c.
References add_new_column_to_pathtarget(), and lfirst.
Referenced by add_paths_with_pathkeys_for_rel(), make_group_input_target(), make_partial_grouping_target(), make_sort_input_target(), and make_window_input_target().
|
static |
Definition at line 1202 of file tlist.c.
References add_column_to_pathtarget(), copyObject, equal(), split_pathtarget_item::expr, PathTarget::exprs, get_pathtarget_sortgroupref, lfirst, list_length(), palloc0(), and split_pathtarget_item::sortgroupref.
Referenced by add_sp_items_to_pathtarget(), and split_pathtarget_at_srfs().
|
static |
Definition at line 1248 of file tlist.c.
References add_sp_item_to_pathtarget(), items, and lfirst.
Referenced by split_pathtarget_at_srfs().
Definition at line 132 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 774 of file tlist.c.
References elog, ERROR, PathTarget::exprs, i, IsA, lfirst, TargetEntry::ressortgroupref, tlist_member(), and tlist_member_match_var().
Referenced by create_projection_plan(), and create_scan_plan().
Definition at line 318 of file tlist.c.
References Assert, forboth, lfirst, list_length(), TargetEntry::resno, and TargetEntry::ressortgroupref.
Referenced by clean_up_removed_plan_level(), create_modifytable_plan(), and create_plan().
PathTarget* copy_pathtarget | ( | PathTarget * | src | ) |
Definition at line 657 of file tlist.c.
References PathTarget::exprs, list_copy(), list_length(), makeNode, and palloc().
Referenced by add_paths_with_pathkeys_for_rel(), 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 186 of file tlist.c.
Referenced by get_update_query_targetlist_def(), transformJsonArrayQueryConstructor(), transformMultiAssignRef(), and transformSubLink().
PathTarget* create_empty_pathtarget | ( | void | ) |
Definition at line 681 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 489 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 514 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 463 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 379 of file tlist.c.
References TargetEntry::expr, and get_sortgroupclause_tle().
Referenced by get_sortgrouplist_exprs(), make_pathkeys_for_sortclauses_extended(), transformAggregateCall(), and transformWindowDefinitions().
TargetEntry* get_sortgroupclause_tle | ( | SortGroupClause * | sgClause, |
List * | targetList | ||
) |
Definition at line 367 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 392 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(), get_windowclause_startup_tuples(), and group_by_has_partkey().
SortGroupClause* get_sortgroupref_clause | ( | Index | sortref, |
List * | clauses | ||
) |
Definition at line 422 of file tlist.c.
References elog, ERROR, lfirst, and SortGroupClause::tleSortGroupRef.
Referenced by preprocess_groupclause().
SortGroupClause* get_sortgroupref_clause_noerr | ( | Index | sortref, |
List * | clauses | ||
) |
Definition at line 443 of file tlist.c.
References lfirst, and SortGroupClause::tleSortGroupRef.
Referenced by find_em_for_rel_target(), foreign_grouping_ok(), group_keys_reorder_by_pathkeys(), make_group_input_target(), and make_partial_grouping_target().
TargetEntry* get_sortgroupref_tle | ( | Index | sortref, |
List * | targetList | ||
) |
Definition at line 345 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 163 of file tlist.c.
References TargetEntry::expr, lappend(), lfirst, and NIL.
Referenced by build_setop_child_paths().
Definition at line 560 of file tlist.c.
References lfirst.
Referenced by choose_hashed_setop(), create_final_distinct_paths(), create_grouping_paths(), create_partial_distinct_paths(), generate_recursion_path(), and generate_union_paths().
Definition at line 540 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(), generate_union_paths(), make_pathkeys_for_window(), and standard_qp_callback().
PathTarget* make_pathtarget_from_tlist | ( | List * | tlist | ) |
Definition at line 591 of file tlist.c.
References TargetEntry::expr, PathTarget::exprs, PathTarget::has_volatile_expr, i, lappend(), lfirst, list_length(), makeNode, palloc(), TargetEntry::ressortgroupref, and VOLATILITY_UNKNOWN.
List* make_tlist_from_pathtarget | ( | PathTarget * | target | ) |
Definition at line 624 of file tlist.c.
References PathTarget::exprs, i, lappend(), lfirst, makeTargetEntry(), NIL, and TargetEntry::ressortgroupref.
Referenced by build_setop_child_paths(), and set_subquery_pathlist().
void split_pathtarget_at_srfs | ( | PlannerInfo * | root, |
PathTarget * | target, | ||
PathTarget * | input_target, | ||
List ** | targets, | ||
List ** | targets_contain_srfs | ||
) |
Definition at line 881 of file tlist.c.
References add_sp_item_to_pathtarget(), add_sp_items_to_pathtarget(), context, create_empty_pathtarget(), split_pathtarget_item::expr, PathTarget::exprs, for_each_cell, forthree, get_pathtarget_sortgroupref, IS_SRF_CALL, lappend(), lappend_int(), lfirst, list_concat(), list_make1, list_make1_int, list_member(), list_nth_cell(), lnext(), NIL, root, set_pathtarget_cost_width(), and split_pathtarget_walker().
Referenced by grouping_planner().
|
static |
Definition at line 1077 of file tlist.c.
References context, split_pathtarget_item::expr, expression_tree_walker, IS_SRF_CALL, IsA, lappend(), 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 79 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 102 of file tlist.c.
References TargetEntry::expr, if(), IsA, lfirst, Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by apply_pathtarget_labeling_to_tlist().
Definition at line 282 of file tlist.c.
References TargetEntry::expr, exprCollation(), lfirst, lfirst_oid, list_head(), and lnext().
Referenced by recurse_set_operations().
Definition at line 248 of file tlist.c.
References TargetEntry::expr, exprType(), lfirst, lfirst_oid, list_head(), and lnext().
Referenced by is_simple_union_all_recurse(), and recurse_set_operations().
Definition at line 218 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().