|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/htup_details.h"#include "access/table.h"#include "foreign/fdwapi.h"#include "nodes/makefuncs.h"#include "nodes/nodeFuncs.h"#include "optimizer/appendinfo.h"#include "optimizer/pathnode.h"#include "optimizer/planmain.h"#include "parser/parsetree.h"#include "utils/lsyscache.h"#include "utils/rel.h"#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
| struct | adjust_appendrel_attrs_context |
| void add_row_identity_columns | ( | PlannerInfo * | root, |
| Index | rtindex, | ||
| RangeTblEntry * | target_rte, | ||
| Relation | target_relation | ||
| ) |
Definition at line 954 of file appendinfo.c.
References add_row_identity_var(), FdwRoutine::AddForeignUpdateTargets, Assert, CMD_DELETE, CMD_MERGE, CMD_UPDATE, fb(), GetFdwRoutineForRelation(), InvalidAttrNumber, InvalidOid, makeVar(), root, and SelfItemPointerAttributeNumber.
Referenced by distribute_row_identity_vars(), expand_single_inheritance_child(), and preprocess_targetlist().
| void add_row_identity_var | ( | PlannerInfo * | root, |
| Var * | orig_var, | ||
| Index | rtindex, | ||
| const char * | rowid_name | ||
| ) |
Definition at line 859 of file appendinfo.c.
References Assert, bms_add_member(), bms_is_member(), bms_make_singleton(), copyObject, elog, equal(), ERROR, exprType(), exprTypmod(), fb(), get_typavgwidth(), IsA, lappend(), lfirst, list_length(), makeNode, makeTargetEntry(), pstrdup(), root, and ROWID_VAR.
Referenced by add_row_identity_columns(), expand_single_inheritance_child(), and postgresAddForeignUpdateTargets().
| Node * adjust_appendrel_attrs | ( | PlannerInfo * | root, |
| Node * | node, | ||
| int | nappinfos, | ||
| AppendRelInfo ** | appinfos | ||
| ) |
Definition at line 200 of file appendinfo.c.
References adjust_appendrel_attrs_mutator(), adjust_appendrel_attrs_context::appinfos, Assert, fb(), IsA, adjust_appendrel_attrs_context::nappinfos, adjust_appendrel_attrs_context::root, and root.
Referenced by add_child_join_rel_equivalences(), add_child_rel_equivalences(), adjust_appendrel_attrs_multilevel(), apply_child_basequals(), apply_scanjoin_target_to_paths(), build_child_join_rel(), build_child_join_reltarget(), build_child_join_sjinfo(), create_partitionwise_grouping_paths(), make_partitionedrel_pruneinfo(), set_append_rel_size(), and try_partitionwise_join().
| Node * adjust_appendrel_attrs_multilevel | ( | PlannerInfo * | root, |
| Node * | node, | ||
| RelOptInfo * | childrel, | ||
| RelOptInfo * | parentrel | ||
| ) |
Definition at line 592 of file appendinfo.c.
References adjust_appendrel_attrs(), adjust_appendrel_attrs_multilevel(), elog, ERROR, fb(), find_appinfos_by_relids(), pfree(), and root.
Referenced by add_child_join_rel_equivalences(), add_child_rel_equivalences(), adjust_appendrel_attrs_multilevel(), create_rel_agg_info(), create_unique_paths(), generate_join_implied_equalities_broken(), get_translated_update_targetlist(), grouping_planner(), and make_partitionedrel_pruneinfo().
|
static |
Definition at line 219 of file appendinfo.c.
References adjust_appendrel_attrs_mutator(), adjust_child_relids(), adjust_appendrel_attrs_context::appinfos, ConvertRowtypeExpr::arg, RowExpr::args, Assert, bms_is_member(), AppendRelInfo::child_relid, COERCE_IMPLICIT_CAST, copyObject, CurrentOfExpr::cvarno, elog, ERROR, expression_tree_mutator, fb(), get_rel_name(), IsA, PlannerInfo::leaf_result_relids, list_length(), list_nth(), ConvertRowtypeExpr::location, RowExpr::location, makeNode, makeNullConst(), adjust_appendrel_attrs_context::nappinfos, NIL, OidIsValid, palloc(), AppendRelInfo::parent_relid, PlannerInfo::parse, ConvertRowtypeExpr::resulttype, adjust_appendrel_attrs_context::root, PlannerInfo::row_identity_vars, ROWID_VAR, rt_fetch, Query::rtable, VAR_RETURNING_DEFAULT, Var::varattno, Var::varlevelsup, Var::varno, and Var::varreturningtype.
Referenced by adjust_appendrel_attrs(), and adjust_appendrel_attrs_mutator().
| Relids adjust_child_relids | ( | Relids | relids, |
| int | nappinfos, | ||
| AppendRelInfo ** | appinfos | ||
| ) |
Definition at line 625 of file appendinfo.c.
References bms_add_member(), bms_copy(), bms_del_member(), bms_is_member(), and fb().
Referenced by adjust_appendrel_attrs_mutator(), adjust_child_relids_multilevel(), build_child_join_rel(), build_child_join_sjinfo(), and try_partitionwise_join().
| Relids adjust_child_relids_multilevel | ( | PlannerInfo * | root, |
| Relids | relids, | ||
| RelOptInfo * | childrel, | ||
| RelOptInfo * | parentrel | ||
| ) |
Definition at line 659 of file appendinfo.c.
References adjust_child_relids(), adjust_child_relids_multilevel(), bms_overlap(), elog, ERROR, fb(), find_appinfos_by_relids(), pfree(), and root.
Referenced by adjust_child_relids_multilevel(), and reparameterize_path_by_child().
| List * adjust_inherited_attnums | ( | List * | attnums, |
| AppendRelInfo * | context | ||
| ) |
Definition at line 699 of file appendinfo.c.
References Assert, elog, ERROR, fb(), get_rel_name(), IsA, lappend_int(), lfirst_int, list_length(), list_nth(), NIL, OidIsValid, AppendRelInfo::parent_reloid, and AppendRelInfo::translated_vars.
Referenced by adjust_inherited_attnums_multilevel().
| List * adjust_inherited_attnums_multilevel | ( | PlannerInfo * | root, |
| List * | attnums, | ||
| Index | child_relid, | ||
| Index | top_parent_relid | ||
| ) |
Definition at line 733 of file appendinfo.c.
References adjust_inherited_attnums(), adjust_inherited_attnums_multilevel(), elog, ERROR, fb(), and root.
Referenced by adjust_inherited_attnums_multilevel(), get_translated_update_targetlist(), and grouping_planner().
| void distribute_row_identity_vars | ( | PlannerInfo * | root | ) |
Definition at line 1035 of file appendinfo.c.
References add_row_identity_columns(), Assert, build_base_rel_tlists(), CMD_DELETE, CMD_MERGE, CMD_UPDATE, copyObject, fb(), find_base_rel(), RangeTblEntry::inh, IsA, lappend(), lfirst, NIL, NoLock, parse(), root, ROWID_VAR, rt_fetch, table_close(), table_open(), and Var::varno.
Referenced by query_planner().
| AppendRelInfo ** find_appinfos_by_relids | ( | PlannerInfo * | root, |
| Relids | relids, | ||
| int * | nappinfos | ||
| ) |
Definition at line 804 of file appendinfo.c.
References bms_next_member(), bms_num_members(), elog, ERROR, fb(), find_base_rel_ignore_join(), i, palloc_array, and root.
Referenced by adjust_appendrel_attrs_multilevel(), adjust_child_relids_multilevel(), apply_scanjoin_target_to_paths(), build_child_join_sjinfo(), create_partitionwise_grouping_paths(), make_partitionedrel_pruneinfo(), and try_partitionwise_join().
| void get_translated_update_targetlist | ( | PlannerInfo * | root, |
| Index | relid, | ||
| List ** | processed_tlist, | ||
| List ** | update_colnos | ||
| ) |
Definition at line 761 of file appendinfo.c.
References adjust_appendrel_attrs_multilevel(), adjust_inherited_attnums_multilevel(), Assert, bms_is_member(), CMD_UPDATE, copyObject, find_base_rel(), and root.
Referenced by postgresPlanDirectModify().
| AppendRelInfo * make_append_rel_info | ( | Relation | parentrel, |
| Relation | childrel, | ||
| Index | parentRTindex, | ||
| Index | childRTindex | ||
| ) |
Definition at line 51 of file appendinfo.c.
References fb(), make_inh_translation_list(), makeNode, and RelationGetRelid.
Referenced by expand_single_inheritance_child().
|
static |
Definition at line 80 of file appendinfo.c.
References Assert, attname, attnum, elog, ereport, errcode(), errmsg(), ERROR, fb(), GETSTRUCT(), HeapTupleIsValid, lappend(), makeVar(), NameStr, NIL, palloc0(), RelationGetDescr, RelationGetRelationName, RelationGetRelid, ReleaseSysCache(), SearchSysCacheAttName(), and TupleDescAttr().
Referenced by make_append_rel_info().