|
PostgreSQL Source Code git master
|


Go to the source code of this file.
Typedefs | |
| typedef void(* | get_relation_info_hook_type) (PlannerInfo *root, Oid relationObjectId, bool inhparent, RelOptInfo *rel) |
Variables | |
| PGDLLIMPORT get_relation_info_hook_type | get_relation_info_hook |
| typedef void(* get_relation_info_hook_type) (PlannerInfo *root, Oid relationObjectId, bool inhparent, RelOptInfo *rel) |
| void add_function_cost | ( | PlannerInfo * | root, |
| Oid | funcid, | ||
| Node * | node, | ||
| QualCost * | cost | ||
| ) |
Definition at line 2211 of file plancat.c.
References cpu_operator_cost, DatumGetPointer(), elog, ERROR, SupportRequestCost::funcid, GETSTRUCT(), HeapTupleIsValid, SupportRequestCost::node, ObjectIdGetDatum(), OidFunctionCall1, OidIsValid, QualCost::per_tuple, SupportRequestCost::per_tuple, PointerGetDatum(), ReleaseSysCache(), root, SupportRequestCost::root, SearchSysCache1(), QualCost::startup, SupportRequestCost::startup, and SupportRequestCost::type.
Referenced by cost_qual_eval_walker(), cost_windowagg(), and get_agg_clause_costs().
| List * build_physical_tlist | ( | PlannerInfo * | root, |
| RelOptInfo * | rel | ||
| ) |
Definition at line 1895 of file plancat.c.
References elog, ERROR, expandRTE(), IsA, lappend(), lfirst, makeTargetEntry(), makeVar(), makeVarFromTargetEntry(), NIL, NoLock, planner_rt_fetch, RelationData::rd_att, RelationGetNumberOfAttributes, RelOptInfo::relid, TargetEntry::resno, root, RTE_CTE, RTE_FUNCTION, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, RangeTblEntry::subquery, table_close(), table_open(), Query::targetList, TupleDescAttr(), and VAR_RETURNING_DEFAULT.
Referenced by create_scan_plan().
| void estimate_rel_size | ( | Relation | rel, |
| int32 * | attr_widths, | ||
| BlockNumber * | pages, | ||
| double * | tuples, | ||
| double * | allvisfrac | ||
| ) |
Definition at line 1161 of file plancat.c.
References get_rel_data_width(), if(), MAXALIGN, RelationData::rd_rel, RelationGetNumberOfBlocks, SizeofHeapTupleHeader, SizeOfPageHeaderData, and table_relation_estimate_size().
Referenced by get_relation_info(), hashbuild(), and plan_create_index_workers().
| Bitmapset * find_relation_notnullatts | ( | PlannerInfo * | root, |
| Oid | relid | ||
| ) |
Definition at line 755 of file plancat.c.
References HASH_FIND, hash_search(), NotnullHashEntry::notnullattnums, and root.
Referenced by get_relation_info(), and var_is_nonnullable().
| Selectivity function_selectivity | ( | PlannerInfo * | root, |
| Oid | funcid, | ||
| List * | args, | ||
| Oid | inputcollid, | ||
| bool | is_join, | ||
| int | varRelid, | ||
| JoinType | jointype, | ||
| SpecialJoinInfo * | sjinfo | ||
| ) |
Definition at line 2157 of file plancat.c.
References generate_unaccent_rules::args, SupportRequestSelectivity::args, DatumGetPointer(), elog, ERROR, SupportRequestSelectivity::funcid, get_func_support(), SupportRequestSelectivity::inputcollid, SupportRequestSelectivity::is_join, SupportRequestSelectivity::jointype, OidFunctionCall1, PointerGetDatum(), root, SupportRequestSelectivity::root, SupportRequestSelectivity::selectivity, SupportRequestSelectivity::sjinfo, SupportRequestSelectivity::type, and SupportRequestSelectivity::varRelid.
Referenced by clause_selectivity_ext().
| Bitmapset * get_dependent_generated_columns | ( | PlannerInfo * | root, |
| Index | rti, | ||
| Bitmapset * | target_cols | ||
| ) |
Definition at line 2493 of file plancat.c.
References AttrDefault::adbin, AttrDefault::adnum, CompactAttribute::attgenerated, bms_add_member(), bms_overlap(), TupleDescData::constr, TupleConstr::defval, FirstLowInvalidHeapAttributeNumber, TupleConstr::has_generated_stored, i, NoLock, TupleConstr::num_defval, planner_rt_fetch, pull_varattnos(), RelationGetDescr, root, stringToNode(), table_close(), table_open(), and TupleDescCompactAttr().
Referenced by get_rel_all_updated_cols().
| double get_function_rows | ( | PlannerInfo * | root, |
| Oid | funcid, | ||
| Node * | node | ||
| ) |
Definition at line 2272 of file plancat.c.
References Assert(), DatumGetPointer(), elog, ERROR, SupportRequestRows::funcid, GETSTRUCT(), HeapTupleIsValid, SupportRequestRows::node, ObjectIdGetDatum(), OidFunctionCall1, OidIsValid, PointerGetDatum(), ReleaseSysCache(), root, SupportRequestRows::root, SupportRequestRows::rows, SearchSysCache1(), and SupportRequestRows::type.
Referenced by expression_returns_set_rows().
Definition at line 1286 of file plancat.c.
References Assert(), clamp_width_est(), get_attavgwidth(), get_typavgwidth(), i, RelationData::rd_att, RelationGetNumberOfAttributes, RelationGetRelid, and TupleDescAttr().
Referenced by estimate_rel_size(), get_relation_data_width(), and table_block_relation_estimate_size().
Definition at line 1328 of file plancat.c.
References get_rel_data_width(), NoLock, table_close(), and table_open().
Referenced by plan_cluster_use_sort(), and set_rel_width().
| void get_relation_info | ( | PlannerInfo * | root, |
| Oid | relationObjectId, | ||
| bool | inhparent, | ||
| RelOptInfo * | rel | ||
| ) |
Definition at line 124 of file plancat.c.
References RelOptInfo::allvisfrac, IndexOptInfo::amcanmarkpos, IndexAmRoutine::amcanorder, IndexAmRoutine::amcanorderbyop, IndexOptInfo::amcanorderbyop, IndexAmRoutine::amcanparallel, IndexOptInfo::amcanparallel, IndexAmRoutine::amcostestimate, IndexOptInfo::amcostestimate, AMFLAG_HAS_TID_RANGE, RelOptInfo::amflags, IndexAmRoutine::amgetbitmap, IndexAmRoutine::amgettreeheight, IndexAmRoutine::amgettuple, IndexOptInfo::amhasgetbitmap, IndexOptInfo::amhasgettuple, IndexAmRoutine::ammarkpos, IndexAmRoutine::amoptionalkey, IndexOptInfo::amoptionalkey, IndexAmRoutine::amrestrpos, IndexAmRoutine::amsearcharray, IndexOptInfo::amsearcharray, IndexAmRoutine::amsearchnulls, IndexOptInfo::amsearchnulls, Assert(), build_index_tlist(), ChangeVarNodes(), COMPARE_LT, ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, estimate_rel_size(), find_relation_notnullatts(), FirstLowInvalidHeapAttributeNumber, FirstNormalObjectId, get_opfamily_member_for_cmptype(), get_ordering_op_properties(), get_relation_foreign_keys(), get_relation_info_hook, get_relation_statistics(), GetFdwRoutineForRelation(), GetForeignServerIdByRelId(), HeapTupleHeaderGetXmin(), IndexOptInfo::hypothetical, i, IgnoreSystemIndexes, IndexOptInfo::immediate, index_can_return(), index_close(), index_open(), RelOptInfo::indexlist, IndexOptInfo::indexoid, IndexOptInfo::indextlist, IndexOptInfo::indpred, IndexOptInfo::indrestrictinfo, InvalidOid, IsSystemRelation(), lcons(), lfirst_oid, list_free(), makeNode, RelOptInfo::max_attr, RelOptInfo::min_attr, IndexOptInfo::ncolumns, NIL, IndexOptInfo::nkeycolumns, NoLock, RelOptInfo::notnullattnums, IndexOptInfo::nullsnotdistinct, OidIsValid, RelOptInfo::pages, IndexOptInfo::pages, palloc(), palloc0(), IndexOptInfo::predOK, RelationData::rd_indam, RelationData::rd_indcollation, RelationData::rd_index, RelationData::rd_indextuple, RelationData::rd_indoption, RelationData::rd_opcintype, RelationData::rd_opfamily, RelationData::rd_rel, RelationData::rd_tableam, RecoveryInProgress(), RelOptInfo::rel_parallel_workers, IndexOptInfo::relam, RelationGetForm, RelationGetIndexAttOptions(), RelationGetIndexExpressions(), RelationGetIndexList(), RelationGetIndexPredicate(), RelationGetNumberOfAttributes, RelationGetNumberOfBlocks, RelationGetParallelWorkers, RelationGetRelationName, RelationGetRelid, RelationIsPermanent, RelOptInfo::relid, RelOptInfo::reltablespace, IndexOptInfo::reltablespace, restrict_nonsystem_relation_kind, RESTRICT_RELKIND_FOREIGN_TABLE, root, TableAmRoutine::scan_bitmap_next_tuple, TableAmRoutine::scan_getnextslot_tidrange, TableAmRoutine::scan_set_tidrange, RelOptInfo::serverid, set_relation_partition_info(), RelOptInfo::statlist, HeapTupleData::t_data, table_close(), table_open(), TransactionIdPrecedes(), TransactionXmin, IndexOptInfo::tree_height, RelOptInfo::tuples, IndexOptInfo::tuples, IndexOptInfo::unique, and unlikely.
Referenced by build_simple_rel().
| void get_relation_notnullatts | ( | PlannerInfo * | root, |
| Relation | relation | ||
| ) |
Definition at line 682 of file plancat.c.
References Assert(), CompactAttribute::attisdropped, CompactAttribute::attnullability, ATTNULLABLE_UNKNOWN, ATTNULLABLE_VALID, bms_add_member(), TupleDescData::constr, CurrentMemoryContext, HASHCTL::entrysize, TupleConstr::has_not_null, HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, HASH_ENTER, hash_search(), HASHCTL::hcxt, i, HASHCTL::keysize, TupleDescData::natts, NotnullHashEntry::notnullattnums, RelationData::rd_att, RelationGetRelid, root, and TupleDescCompactAttr().
Referenced by expand_single_inheritance_child(), and preprocess_relation_rtes().
| bool has_row_triggers | ( | PlannerInfo * | root, |
| Index | rti, | ||
| CmdType | event | ||
| ) |
Definition at line 2362 of file plancat.c.
References CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_UPDATE, elog, ERROR, NoLock, planner_rt_fetch, root, table_close(), table_open(), TriggerDesc::trig_delete_after_row, TriggerDesc::trig_delete_before_row, TriggerDesc::trig_insert_after_row, TriggerDesc::trig_insert_before_row, TriggerDesc::trig_update_after_row, TriggerDesc::trig_update_before_row, and RelationData::trigdesc.
Referenced by make_modifytable().
| bool has_stored_generated_columns | ( | PlannerInfo * | root, |
| Index | rti | ||
| ) |
Definition at line 2466 of file plancat.c.
References TupleDescData::constr, TupleConstr::has_generated_stored, NoLock, planner_rt_fetch, RelationGetDescr, root, table_close(), and table_open().
Referenced by make_modifytable().
| bool has_transition_tables | ( | PlannerInfo * | root, |
| Index | rti, | ||
| CmdType | event | ||
| ) |
Definition at line 2412 of file plancat.c.
References Assert(), CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_UPDATE, elog, ERROR, NoLock, planner_rt_fetch, root, RTE_RELATION, RangeTblEntry::rtekind, table_close(), table_open(), TriggerDesc::trig_delete_old_table, TriggerDesc::trig_insert_new_table, TriggerDesc::trig_update_new_table, TriggerDesc::trig_update_old_table, and RelationData::trigdesc.
Referenced by make_modifytable().
| bool has_unique_index | ( | RelOptInfo * | rel, |
| AttrNumber | attno | ||
| ) |
Definition at line 2330 of file plancat.c.
References RelOptInfo::indexlist, lfirst, and NIL.
Referenced by examine_variable().
| List * infer_arbiter_indexes | ( | PlannerInfo * | root | ) |
Definition at line 799 of file plancat.c.
References OnConflictExpr::action, OnConflictExpr::arbiterElems, OnConflictExpr::arbiterWhere, bms_add_member(), bms_equal(), ChangeVarNodes(), OnConflictExpr::constraint, ereport, errcode(), errmsg(), ERROR, InferenceElem::expr, FirstLowInvalidHeapAttributeNumber, get_constraint_index(), if(), index_close(), index_open(), infer_collation_opclass_match(), InferenceElem::infercollid, InferenceElem::inferopclass, InvalidOid, IsA, lappend(), lappend_oid(), lfirst, lfirst_oid, list_difference(), list_free(), list_member(), next, NIL, NoLock, ONCONFLICT_UPDATE, predicate_implied_by(), RelationData::rd_index, RelationGetIndexExpressions(), RelationGetIndexList(), RelationGetIndexPredicate(), root, rt_fetch, table_close(), table_open(), and Var::varattno.
Referenced by make_modifytable().
| Selectivity join_selectivity | ( | PlannerInfo * | root, |
| Oid | operatorid, | ||
| List * | args, | ||
| Oid | inputcollid, | ||
| JoinType | jointype, | ||
| SpecialJoinInfo * | sjinfo | ||
| ) |
Definition at line 2117 of file plancat.c.
References generate_unaccent_rules::args, DatumGetFloat8(), elog, ERROR, get_oprjoin(), Int16GetDatum(), ObjectIdGetDatum(), OidFunctionCall5Coll(), PointerGetDatum(), and root.
Referenced by clause_selectivity_ext(), rowcomparesel(), and test_support_func().
| bool relation_excluded_by_constraints | ( | PlannerInfo * | root, |
| RelOptInfo * | rel, | ||
| RangeTblEntry * | rte | ||
| ) |
Definition at line 1705 of file plancat.c.
References Assert(), RelOptInfo::baserestrictinfo, RestrictInfo::clause, constraint_exclusion, CONSTRAINT_EXCLUSION_OFF, CONSTRAINT_EXCLUSION_ON, CONSTRAINT_EXCLUSION_PARTITION, contain_mutable_functions(), DatumGetBool(), get_relation_constraints(), RangeTblEntry::inh, IS_SIMPLE_REL, IsA, lappend(), lfirst, NIL, predicate_refuted_by(), RELOPT_BASEREL, RELOPT_OTHER_MEMBER_REL, RelOptInfo::reloptkind, root, RTE_RELATION, and RangeTblEntry::rtekind.
Referenced by set_append_rel_size(), and set_rel_size().
| Selectivity restriction_selectivity | ( | PlannerInfo * | root, |
| Oid | operatorid, | ||
| List * | args, | ||
| Oid | inputcollid, | ||
| int | varRelid | ||
| ) |
Definition at line 2078 of file plancat.c.
References generate_unaccent_rules::args, DatumGetFloat8(), elog, ERROR, get_oprrest(), Int32GetDatum(), ObjectIdGetDatum(), OidFunctionCall4Coll(), PointerGetDatum(), and root.
Referenced by clause_selectivity_ext(), rowcomparesel(), and test_support_func().
|
extern |
Definition at line 61 of file plancat.c.
Referenced by get_relation_info().