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 2097 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 1772 of file plancat.c.
References elog, ERROR, expandRTE(), IsA, lappend(), lfirst, makeTargetEntry(), makeVar(), makeVarFromTargetEntry(), NIL, NoLock, planner_rt_fetch, RelationData::rd_att, RelationGetNumberOfAttributes, RangeTblEntry::relid, 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, and TupleDescAttr.
Referenced by create_scan_plan().
void estimate_rel_size | ( | Relation | rel, |
int32 * | attr_widths, | ||
BlockNumber * | pages, | ||
double * | tuples, | ||
double * | allvisfrac | ||
) |
Definition at line 1066 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().
Selectivity function_selectivity | ( | PlannerInfo * | root, |
Oid | funcid, | ||
List * | args, | ||
Oid | inputcollid, | ||
bool | is_join, | ||
int | varRelid, | ||
JoinType | jointype, | ||
SpecialJoinInfo * | sjinfo | ||
) |
Definition at line 2035 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 2325 of file plancat.c.
References AttrDefault::adbin, AttrDefault::adnum, 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, RangeTblEntry::relid, root, stringToNode(), table_close(), table_open(), and TupleDescAttr.
Referenced by get_rel_all_updated_cols().
double get_function_rows | ( | PlannerInfo * | root, |
Oid | funcid, | ||
Node * | node | ||
) |
Definition at line 2158 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 1191 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 1233 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 116 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, bms_add_member(), BTLessStrategyNumber, build_index_tlist(), ChangeVarNodes(), ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, estimate_rel_size(), FirstLowInvalidHeapAttributeNumber, FirstNormalObjectId, get_opfamily_member(), 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, TupleDescData::natts, IndexOptInfo::ncolumns, NIL, IndexOptInfo::nkeycolumns, NoLock, RelOptInfo::notnullattnums, OidIsValid, RelOptInfo::pages, IndexOptInfo::pages, palloc(), palloc0(), IndexOptInfo::predOK, RelationData::rd_att, 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_block, 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, TupleDescAttr, RelOptInfo::tuples, IndexOptInfo::tuples, IndexOptInfo::unique, and unlikely.
Referenced by build_simple_rel().
bool has_row_triggers | ( | PlannerInfo * | root, |
Index | rti, | ||
CmdType | event | ||
) |
Definition at line 2248 of file plancat.c.
References CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_UPDATE, elog, ERROR, NoLock, planner_rt_fetch, RangeTblEntry::relid, 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 2298 of file plancat.c.
References TupleDescData::constr, TupleConstr::has_generated_stored, NoLock, planner_rt_fetch, RelationGetDescr, RangeTblEntry::relid, root, table_close(), and table_open().
Referenced by make_modifytable().
bool has_unique_index | ( | RelOptInfo * | rel, |
AttrNumber | attno | ||
) |
Definition at line 2216 of file plancat.c.
References RelOptInfo::indexlist, lfirst, and NIL.
Referenced by examine_variable().
List* infer_arbiter_indexes | ( | PlannerInfo * | root | ) |
Definition at line 704 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(), RangeTblEntry::relid, 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 1994 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 1582 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(), RangeTblEntry::relid, 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 1955 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 60 of file plancat.c.
Referenced by get_relation_info().