PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/sysattr.h"
#include "access/table.h"
#include "catalog/partition.h"
#include "catalog/pg_inherits.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "optimizer/appendinfo.h"
#include "optimizer/inherit.h"
#include "optimizer/optimizer.h"
#include "optimizer/pathnode.h"
#include "optimizer/planmain.h"
#include "optimizer/planner.h"
#include "optimizer/prep.h"
#include "optimizer/restrictinfo.h"
#include "parser/parsetree.h"
#include "partitioning/partdesc.h"
#include "partitioning/partprune.h"
#include "utils/rel.h"
Go to the source code of this file.
Functions | |
static void | expand_partitioned_rtentry (PlannerInfo *root, RelOptInfo *relinfo, RangeTblEntry *parentrte, Index parentRTindex, Relation parentrel, PlanRowMark *top_parentrc, LOCKMODE lockmode) |
static void | expand_single_inheritance_child (PlannerInfo *root, RangeTblEntry *parentrte, Index parentRTindex, Relation parentrel, PlanRowMark *top_parentrc, Relation childrel, RangeTblEntry **childrte_p, Index *childRTindex_p) |
static Bitmapset * | translate_col_privs (const Bitmapset *parent_privs, List *translated_vars) |
static void | expand_appendrel_subquery (PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte, Index rti) |
void | expand_inherited_rtentry (PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte, Index rti) |
bool | apply_child_basequals (PlannerInfo *root, RelOptInfo *parentrel, RelOptInfo *childrel, RangeTblEntry *childRTE, AppendRelInfo *appinfo) |
bool apply_child_basequals | ( | PlannerInfo * | root, |
RelOptInfo * | parentrel, | ||
RelOptInfo * | childrel, | ||
RangeTblEntry * | childRTE, | ||
AppendRelInfo * | appinfo | ||
) |
Definition at line 754 of file inherit.c.
References adjust_appendrel_attrs(), Assert(), RelOptInfo::baserestrict_min_security, RelOptInfo::baserestrictinfo, RestrictInfo::clause, contain_vars_of_level(), contain_volatile_functions(), DatumGetBool, eval_const_expressions(), PlannerInfo::hasPseudoConstantQuals, RestrictInfo::is_pushed_down, IsA, lappend(), lfirst, make_ands_implicit(), make_restrictinfo(), Min, NIL, RestrictInfo::outerjoin_delayed, RestrictInfo::security_level, and RangeTblEntry::securityQuals.
Referenced by build_simple_rel().
|
static |
Definition at line 713 of file inherit.c.
References PlannerInfo::append_rel_list, Assert(), build_simple_rel(), AppendRelInfo::child_relid, expand_inherited_rtentry(), RangeTblEntry::inh, lfirst, AppendRelInfo::parent_relid, and PlannerInfo::simple_rte_array.
Referenced by expand_inherited_rtentry().
void expand_inherited_rtentry | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
RangeTblEntry * | rte, | ||
Index | rti | ||
) |
Definition at line 79 of file inherit.c.
References add_vars_to_targetlist(), PlanRowMark::allMarkTypes, Assert(), bms_make_singleton(), build_simple_rel(), expand_appendrel_subquery(), expand_partitioned_rtentry(), expand_planner_arrays(), expand_single_inheritance_child(), find_all_inheritors(), get_plan_rowmark(), RangeTblEntry::inh, InvalidOid, PlanRowMark::isParent, lappend(), lfirst_oid, linitial_oid, list_length(), makeTargetEntry(), makeVar(), makeWholeRowVar(), NIL, NoLock, planner_rt_fetch, PlannerInfo::processed_tlist, pstrdup(), RelationData::rd_rel, RELATION_IS_OTHER_TEMP, RangeTblEntry::relid, RangeTblEntry::relkind, RangeTblEntry::rellockmode, ROW_MARK_COPY, PlanRowMark::rowmarkId, PlannerInfo::rowMarks, RTE_RELATION, RTE_SUBQUERY, RangeTblEntry::rtekind, PlanRowMark::rti, SelfItemPointerAttributeNumber, snprintf, table_close(), table_open(), and TableOidAttributeNumber.
Referenced by add_other_rels_to_query(), and expand_appendrel_subquery().
|
static |
Definition at line 305 of file inherit.c.
References RelOptInfo::all_partrels, Assert(), bms_add_members(), bms_next_member(), bms_num_members(), build_simple_rel(), check_stack_depth(), elog, ERROR, expand_planner_arrays(), expand_single_inheritance_child(), RangeTblEntry::extraUpdatedCols, PlannerInfo::glob, has_partition_attrs(), i, RangeTblEntry::inh, RelOptInfo::live_parts, NoLock, RelOptInfo::nparts, PartitionDescData::nparts, PartitionDescData::oids, palloc0(), RelOptInfo::part_rels, PlannerInfo::partColsUpdated, PlannerGlobal::partition_directory, PartitionDirectoryLookup(), prune_append_rel_partitions(), RelationData::rd_rel, RELATION_IS_OTHER_TEMP, RelOptInfo::relids, table_close(), table_open(), and RangeTblEntry::updatedCols.
Referenced by expand_inherited_rtentry().
|
static |
Definition at line 435 of file inherit.c.
References add_row_identity_columns(), add_row_identity_var(), RangeTblEntry::alias, Alias::aliasname, PlannerInfo::all_result_relids, PlanRowMark::allMarkTypes, PlannerInfo::append_rel_array, PlannerInfo::append_rel_list, Assert(), attname, bms_add_member(), bms_copy(), bms_is_member(), Alias::colnames, copyObject, RangeTblEntry::eref, RangeTblEntry::extraUpdatedCols, RangeTblEntry::inh, RangeTblEntry::insertedCols, InvalidOid, PlanRowMark::isParent, lappend(), PlannerInfo::leaf_result_relids, list_length(), list_nth(), make_append_rel_info(), makeAlias(), makeNode, makeString(), makeVar(), PlanRowMark::markType, NameStr, TupleDescData::natts, NIL, AppendRelInfo::parent_colnos, parse(), PlannerInfo::parse, PlanRowMark::prti, pstrdup(), RelationData::rd_rel, RelationGetDescr, RelationGetRelid, RangeTblEntry::relid, RangeTblEntry::relkind, RangeTblEntry::requiredPerms, PlanRowMark::rowmarkId, PlannerInfo::rowMarks, RTE_RELATION, RangeTblEntry::rtekind, PlanRowMark::rti, RangeTblEntry::securityQuals, select_rowmark_type(), RangeTblEntry::selectedCols, PlannerInfo::simple_rte_array, PlanRowMark::strength, strVal, TableOidAttributeNumber, RangeTblEntry::tablesample, translate_col_privs(), AppendRelInfo::translated_vars, TupleDescAttr, RangeTblEntry::updatedCols, and PlanRowMark::waitPolicy.
Referenced by expand_inherited_rtentry(), and expand_partitioned_rtentry().
|
static |
Definition at line 663 of file inherit.c.
References bms_add_member(), bms_is_member(), FirstLowInvalidHeapAttributeNumber, InvalidAttrNumber, lfirst_node, and Var::varattno.
Referenced by expand_single_inheritance_child().