PostgreSQL Source Code git master
|
Go to the source code of this file.
Data Structures | |
struct | EstimationInfo |
struct | VariableStatData |
struct | GenericCosts |
Macros | |
#define | DEFAULT_EQ_SEL 0.005 |
#define | DEFAULT_INEQ_SEL 0.3333333333333333 |
#define | DEFAULT_RANGE_INEQ_SEL 0.005 |
#define | DEFAULT_MULTIRANGE_INEQ_SEL 0.005 |
#define | DEFAULT_MATCH_SEL 0.005 |
#define | DEFAULT_MATCHING_SEL 0.010 |
#define | DEFAULT_NUM_DISTINCT 200 |
#define | DEFAULT_UNK_SEL 0.005 |
#define | DEFAULT_NOT_UNK_SEL (1.0 - DEFAULT_UNK_SEL) |
#define | CLAMP_PROBABILITY(p) |
#define | SELFLAG_USED_DEFAULT |
#define | ReleaseVariableStats(vardata) |
Typedefs | |
typedef struct EstimationInfo | EstimationInfo |
typedef struct VariableStatData | VariableStatData |
typedef bool(* | get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata) |
typedef bool(* | get_index_stats_hook_type) (PlannerInfo *root, Oid indexOid, AttrNumber indexattnum, VariableStatData *vardata) |
Functions | |
void | examine_variable (PlannerInfo *root, Node *node, int varRelid, VariableStatData *vardata) |
bool | statistic_proc_security_check (VariableStatData *vardata, Oid func_oid) |
bool | get_restriction_variable (PlannerInfo *root, List *args, int varRelid, VariableStatData *vardata, Node **other, bool *varonleft) |
void | get_join_variables (PlannerInfo *root, List *args, SpecialJoinInfo *sjinfo, VariableStatData *vardata1, VariableStatData *vardata2, bool *join_is_reversed) |
double | get_variable_numdistinct (VariableStatData *vardata, bool *isdefault) |
double | mcv_selectivity (VariableStatData *vardata, FmgrInfo *opproc, Oid collation, Datum constval, bool varonleft, double *sumcommonp) |
double | histogram_selectivity (VariableStatData *vardata, FmgrInfo *opproc, Oid collation, Datum constval, bool varonleft, int min_hist_size, int n_skip, int *hist_size) |
double | generic_restriction_selectivity (PlannerInfo *root, Oid oproid, Oid collation, List *args, int varRelid, double default_selectivity) |
double | ineq_histogram_selectivity (PlannerInfo *root, VariableStatData *vardata, Oid opoid, FmgrInfo *opproc, bool isgt, bool iseq, Oid collation, Datum constval, Oid consttype) |
double | var_eq_const (VariableStatData *vardata, Oid oproid, Oid collation, Datum constval, bool constisnull, bool varonleft, bool negate) |
double | var_eq_non_const (VariableStatData *vardata, Oid oproid, Oid collation, Node *other, bool varonleft, bool negate) |
Selectivity | boolvarsel (PlannerInfo *root, Node *arg, int varRelid) |
Selectivity | booltestsel (PlannerInfo *root, BoolTestType booltesttype, Node *arg, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo) |
Selectivity | nulltestsel (PlannerInfo *root, NullTestType nulltesttype, Node *arg, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo) |
Selectivity | scalararraysel (PlannerInfo *root, ScalarArrayOpExpr *clause, bool is_join_clause, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo) |
double | estimate_array_length (PlannerInfo *root, Node *arrayexpr) |
Selectivity | rowcomparesel (PlannerInfo *root, RowCompareExpr *clause, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo) |
void | mergejoinscansel (PlannerInfo *root, Node *clause, Oid opfamily, int strategy, bool nulls_first, Selectivity *leftstart, Selectivity *leftend, Selectivity *rightstart, Selectivity *rightend) |
double | estimate_num_groups (PlannerInfo *root, List *groupExprs, double input_rows, List **pgset, EstimationInfo *estinfo) |
void | estimate_hash_bucket_stats (PlannerInfo *root, Node *hashkey, double nbuckets, Selectivity *mcv_freq, Selectivity *bucketsize_frac) |
double | estimate_hashagg_tablesize (PlannerInfo *root, Path *path, const AggClauseCosts *agg_costs, double dNumGroups) |
List * | get_quals_from_indexclauses (List *indexclauses) |
Cost | index_other_operands_eval_cost (PlannerInfo *root, List *indexquals) |
List * | add_predicate_to_index_quals (IndexOptInfo *index, List *indexQuals) |
void | genericcostestimate (PlannerInfo *root, IndexPath *path, double loop_count, GenericCosts *costs) |
Selectivity | scalararraysel_containment (PlannerInfo *root, Node *leftop, Node *rightop, Oid elemtype, bool isEquality, bool useOr, int varRelid) |
Variables | |
PGDLLIMPORT get_relation_stats_hook_type | get_relation_stats_hook |
PGDLLIMPORT get_index_stats_hook_type | get_index_stats_hook |
#define CLAMP_PROBABILITY | ( | p | ) |
Definition at line 63 of file selfuncs.h.
#define DEFAULT_EQ_SEL 0.005 |
Definition at line 34 of file selfuncs.h.
#define DEFAULT_INEQ_SEL 0.3333333333333333 |
Definition at line 37 of file selfuncs.h.
#define DEFAULT_MATCH_SEL 0.005 |
Definition at line 46 of file selfuncs.h.
#define DEFAULT_MATCHING_SEL 0.010 |
Definition at line 49 of file selfuncs.h.
#define DEFAULT_MULTIRANGE_INEQ_SEL 0.005 |
Definition at line 43 of file selfuncs.h.
#define DEFAULT_NOT_UNK_SEL (1.0 - DEFAULT_UNK_SEL) |
Definition at line 56 of file selfuncs.h.
#define DEFAULT_NUM_DISTINCT 200 |
Definition at line 52 of file selfuncs.h.
#define DEFAULT_RANGE_INEQ_SEL 0.005 |
Definition at line 40 of file selfuncs.h.
#define DEFAULT_UNK_SEL 0.005 |
Definition at line 55 of file selfuncs.h.
#define ReleaseVariableStats | ( | vardata | ) |
Definition at line 99 of file selfuncs.h.
#define SELFLAG_USED_DEFAULT |
Definition at line 76 of file selfuncs.h.
typedef struct EstimationInfo EstimationInfo |
typedef bool(* get_index_stats_hook_type) (PlannerInfo *root, Oid indexOid, AttrNumber indexattnum, VariableStatData *vardata) |
Definition at line 143 of file selfuncs.h.
typedef bool(* get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata) |
Definition at line 138 of file selfuncs.h.
typedef struct VariableStatData VariableStatData |
List * add_predicate_to_index_quals | ( | IndexOptInfo * | index, |
List * | indexQuals | ||
) |
Definition at line 6801 of file selfuncs.c.
References lfirst, list_concat(), list_make1, NIL, and predicate_implied_by().
Referenced by btcostestimate(), genericcostestimate(), and gincostestimate().
Selectivity booltestsel | ( | PlannerInfo * | root, |
BoolTestType | booltesttype, | ||
Node * | arg, | ||
int | varRelid, | ||
JoinType | jointype, | ||
SpecialJoinInfo * | sjinfo | ||
) |
Definition at line 1541 of file selfuncs.c.
References arg, ATTSTATSSLOT_NUMBERS, ATTSTATSSLOT_VALUES, CLAMP_PROBABILITY, clause_selectivity(), DatumGetBool(), DEFAULT_NOT_UNK_SEL, DEFAULT_UNK_SEL, elog, ERROR, examine_variable(), free_attstatsslot(), get_attstatsslot(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, IS_FALSE, IS_NOT_FALSE, IS_NOT_TRUE, IS_NOT_UNKNOWN, IS_TRUE, IS_UNKNOWN, AttStatsSlot::nnumbers, AttStatsSlot::numbers, ReleaseVariableStats, root, VariableStatData::statsTuple, and AttStatsSlot::values.
Referenced by clause_selectivity_ext().
Selectivity boolvarsel | ( | PlannerInfo * | root, |
Node * | arg, | ||
int | varRelid | ||
) |
Definition at line 1513 of file selfuncs.c.
References arg, BoolGetDatum(), examine_variable(), HeapTupleIsValid, InvalidOid, ReleaseVariableStats, root, VariableStatData::statsTuple, and var_eq_const().
Referenced by clause_selectivity_ext().
double estimate_array_length | ( | PlannerInfo * | root, |
Node * | arrayexpr | ||
) |
Definition at line 2140 of file selfuncs.c.
References ARR_DIMS, ARR_NDIM, ArrayGetNItems(), ATTSTATSSLOT_NUMBERS, clamp_row_est(), DatumGetArrayTypeP, examine_variable(), free_attstatsslot(), get_attstatsslot(), HeapTupleIsValid, InvalidOid, IsA, list_length(), AttStatsSlot::nnumbers, AttStatsSlot::numbers, ReleaseVariableStats, root, VariableStatData::statsTuple, and strip_array_coercion().
Referenced by array_unnest_support(), btcostestimate(), cost_qual_eval_walker(), cost_tidscan(), genericcostestimate(), and gincost_scalararrayopexpr().
void estimate_hash_bucket_stats | ( | PlannerInfo * | root, |
Node * | hashkey, | ||
double | nbuckets, | ||
Selectivity * | mcv_freq, | ||
Selectivity * | bucketsize_frac | ||
) |
Definition at line 3812 of file selfuncs.c.
References ATTSTATSSLOT_NUMBERS, clamp_row_est(), examine_variable(), free_attstatsslot(), get_attstatsslot(), get_variable_numdistinct(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, Max, AttStatsSlot::nnumbers, AttStatsSlot::numbers, VariableStatData::rel, ReleaseVariableStats, root, RelOptInfo::rows, VariableStatData::statsTuple, and RelOptInfo::tuples.
Referenced by final_cost_hashjoin().
double estimate_hashagg_tablesize | ( | PlannerInfo * | root, |
Path * | path, | ||
const AggClauseCosts * | agg_costs, | ||
double | dNumGroups | ||
) |
Definition at line 3931 of file selfuncs.c.
References hash_agg_entry_size(), list_length(), root, and AggClauseCosts::transitionSpace.
Referenced by consider_groupingsets_paths().
double estimate_num_groups | ( | PlannerInfo * | root, |
List * | groupExprs, | ||
double | input_rows, | ||
List ** | pgset, | ||
EstimationInfo * | estinfo | ||
) |
Definition at line 3430 of file selfuncs.c.
References add_unique_group_var(), Assert, clamp_row_est(), contain_volatile_functions(), estimate_multivariate_ndistinct(), examine_variable(), expression_returns_set_rows(), exprType(), EstimationInfo::flags, for_each_from, HeapTupleIsValid, i, IS_SIMPLE_REL, GroupVarInfo::isdefault, VariableStatData::isunique, lappend(), lfirst, linitial, list_member_int(), GroupVarInfo::ndistinct, NIL, pull_var_clause(), PVC_RECURSE_AGGREGATES, PVC_RECURSE_PLACEHOLDERS, PVC_RECURSE_WINDOWFUNCS, GroupVarInfo::rel, ReleaseVariableStats, root, RelOptInfo::rows, SELFLAG_USED_DEFAULT, VariableStatData::statsTuple, and RelOptInfo::tuples.
Referenced by adjust_rowcount_for_semijoins(), build_setop_child_paths(), cost_incremental_sort(), cost_memoize_rescan(), create_final_distinct_paths(), create_partial_distinct_paths(), create_unique_path(), estimate_path_cost_size(), get_number_of_groups(), and get_windowclause_startup_tuples().
void examine_variable | ( | PlannerInfo * | root, |
Node * | node, | ||
int | varRelid, | ||
VariableStatData * | vardata | ||
) |
Definition at line 5033 of file selfuncs.c.
References VariableStatData::acl_ok, ACL_SELECT, ACLCHECK_OK, arg, Assert, VariableStatData::atttype, VariableStatData::atttypmod, bms_difference(), bms_free(), bms_get_singleton_member(), bms_is_empty, bms_is_member(), bms_overlap(), BoolGetDatum(), elog, equal(), ERROR, examine_simple_variable(), StatisticExtInfo::exprs, exprType(), exprTypmod(), find_base_rel(), find_join_rel(), VariableStatData::freefunc, get_index_stats_hook, GetUserId(), has_unique_index(), HeapTupleIsValid, if(), RelOptInfo::indexlist, RangeTblEntry::inh, StatisticExtInfo::inherit, Int16GetDatum(), IsA, VariableStatData::isunique, StatisticExtInfo::kind, lfirst, list_head(), lnext(), MemSet, NIL, ObjectIdGetDatum(), OidIsValid, AppendRelInfo::parent_relid, pg_class_aclcheck(), planner_rt_fetch, pull_varnos(), VariableStatData::rel, ReleaseDummy(), ReleaseSysCache(), RangeTblEntry::relid, RelOptInfo::relid, remove_nulling_relids(), root, RTE_RELATION, RangeTblEntry::rtekind, SearchSysCache3(), statext_expressions_load(), RelOptInfo::statlist, StatisticExtInfo::statOid, VariableStatData::statsTuple, RelOptInfo::userid, VariableStatData::var, Var::varattno, Var::varno, and VariableStatData::vartype.
Referenced by booltestsel(), boolvarsel(), estimate_array_length(), estimate_hash_bucket_stats(), estimate_num_groups(), get_join_variables(), get_restriction_variable(), mergejoinscansel(), nulltestsel(), and scalararraysel_containment().
double generic_restriction_selectivity | ( | PlannerInfo * | root, |
Oid | oproid, | ||
Oid | collation, | ||
List * | args, | ||
int | varRelid, | ||
double | default_selectivity | ||
) |
Definition at line 915 of file selfuncs.c.
References generate_unaccent_rules::args, CLAMP_PROBABILITY, fmgr_info(), get_opcode(), get_restriction_variable(), GETSTRUCT(), HeapTupleIsValid, histogram_selectivity(), IsA, mcv_selectivity(), ReleaseVariableStats, root, and VariableStatData::statsTuple.
Referenced by ltreeparentsel(), and matchingsel().
void genericcostestimate | ( | PlannerInfo * | root, |
IndexPath * | path, | ||
double | loop_count, | ||
GenericCosts * | costs | ||
) |
Definition at line 6578 of file selfuncs.c.
References add_predicate_to_index_quals(), ScalarArrayOpExpr::args, RestrictInfo::clause, clauselist_selectivity(), cpu_index_tuple_cost, cpu_operator_cost, estimate_array_length(), get_quals_from_indexclauses(), get_tablespace_page_costs(), index_other_operands_eval_cost(), index_pages_fetched(), IndexPath::indexclauses, GenericCosts::indexCorrelation, IndexPath::indexinfo, IndexPath::indexorderbys, GenericCosts::indexSelectivity, GenericCosts::indexStartupCost, GenericCosts::indexTotalCost, IsA, JOIN_INNER, lfirst, list_length(), lsecond, GenericCosts::num_sa_scans, GenericCosts::numIndexPages, GenericCosts::numIndexTuples, root, and GenericCosts::spc_random_page_cost.
Referenced by blcostestimate(), btcostestimate(), gistcostestimate(), hashcostestimate(), and spgcostestimate().
void get_join_variables | ( | PlannerInfo * | root, |
List * | args, | ||
SpecialJoinInfo * | sjinfo, | ||
VariableStatData * | vardata1, | ||
VariableStatData * | vardata2, | ||
bool * | join_is_reversed | ||
) |
Definition at line 4964 of file selfuncs.c.
References generate_unaccent_rules::args, bms_is_subset(), elog, ERROR, examine_variable(), linitial, list_length(), lsecond, VariableStatData::rel, RelOptInfo::relids, root, SpecialJoinInfo::syn_lefthand, and SpecialJoinInfo::syn_righthand.
Referenced by eqjoinsel(), neqjoinsel(), and networkjoinsel().
Definition at line 6494 of file selfuncs.c.
References IndexClause::indexquals, lappend(), lfirst_node, and NIL.
Referenced by brincostestimate(), genericcostestimate(), and gincostestimate().
bool get_restriction_variable | ( | PlannerInfo * | root, |
List * | args, | ||
int | varRelid, | ||
VariableStatData * | vardata, | ||
Node ** | other, | ||
bool * | varonleft | ||
) |
Definition at line 4904 of file selfuncs.c.
References generate_unaccent_rules::args, estimate_expression_value(), examine_variable(), linitial, list_length(), lsecond, VariableStatData::rel, ReleaseVariableStats, root, and VariableStatData::var.
Referenced by _int_matchsel(), arraycontsel(), eqsel_internal(), generic_restriction_selectivity(), multirangesel(), networksel(), patternsel_common(), rangesel(), scalarineqsel_wrapper(), and tsmatchsel().
double get_variable_numdistinct | ( | VariableStatData * | vardata, |
bool * | isdefault | ||
) |
Definition at line 5798 of file selfuncs.c.
References clamp_row_est(), DEFAULT_NUM_DISTINCT, GETSTRUCT(), HeapTupleIsValid, IsA, VariableStatData::isunique, VariableStatData::rel, RTE_VALUES, RelOptInfo::rtekind, SelfItemPointerAttributeNumber, VariableStatData::statsTuple, TableOidAttributeNumber, RelOptInfo::tuples, VariableStatData::var, and VariableStatData::vartype.
Referenced by add_unique_group_var(), eqjoinsel(), estimate_hash_bucket_stats(), ineq_histogram_selectivity(), var_eq_const(), and var_eq_non_const().
double histogram_selectivity | ( | VariableStatData * | vardata, |
FmgrInfo * | opproc, | ||
Oid | collation, | ||
Datum | constval, | ||
bool | varonleft, | ||
int | min_hist_size, | ||
int | n_skip, | ||
int * | hist_size | ||
) |
Definition at line 824 of file selfuncs.c.
References Assert, ATTSTATSSLOT_VALUES, DatumGetBool(), FmgrInfo::fn_oid, free_attstatsslot(), FunctionCallInvoke, get_attstatsslot(), HeapTupleIsValid, i, InitFunctionCallInfoData, InvalidOid, LOCAL_FCINFO, AttStatsSlot::nvalues, statistic_proc_security_check(), VariableStatData::statsTuple, and AttStatsSlot::values.
Referenced by generic_restriction_selectivity(), and patternsel_common().
Cost index_other_operands_eval_cost | ( | PlannerInfo * | root, |
List * | indexquals | ||
) |
Definition at line 6524 of file selfuncs.c.
References OpExpr::args, ScalarArrayOpExpr::args, cost_qual_eval_node(), elog, ERROR, IsA, lfirst, lsecond, nodeTag, QualCost::per_tuple, RowCompareExpr::rargs, root, and QualCost::startup.
Referenced by brincostestimate(), genericcostestimate(), and gincostestimate().
double ineq_histogram_selectivity | ( | PlannerInfo * | root, |
VariableStatData * | vardata, | ||
Oid | opoid, | ||
FmgrInfo * | opproc, | ||
bool | isgt, | ||
bool | iseq, | ||
Oid | collation, | ||
Datum | constval, | ||
Oid | consttype | ||
) |
Definition at line 1042 of file selfuncs.c.
References ATTSTATSSLOT_NUMBERS, ATTSTATSSLOT_VALUES, CLAMP_PROBABILITY, comparison_ops_are_compatible(), convert_to_scalar(), DatumGetBool(), FmgrInfo::fn_oid, free_attstatsslot(), FunctionCall2Coll(), FunctionCallInvoke, get_actual_variable_range(), get_attstatsslot(), get_variable_numdistinct(), HeapTupleIsValid, i, InitFunctionCallInfoData, InvalidOid, LOCAL_FCINFO, AttStatsSlot::nnumbers, AttStatsSlot::nvalues, root, AttStatsSlot::stacoll, AttStatsSlot::staop, statistic_proc_security_check(), VariableStatData::statsTuple, val, AttStatsSlot::values, and VariableStatData::vartype.
Referenced by prefix_selectivity(), and scalarineqsel().
double mcv_selectivity | ( | VariableStatData * | vardata, |
FmgrInfo * | opproc, | ||
Oid | collation, | ||
Datum | constval, | ||
bool | varonleft, | ||
double * | sumcommonp | ||
) |
Definition at line 733 of file selfuncs.c.
References ATTSTATSSLOT_NUMBERS, ATTSTATSSLOT_VALUES, DatumGetBool(), FmgrInfo::fn_oid, free_attstatsslot(), FunctionCallInvoke, get_attstatsslot(), HeapTupleIsValid, i, InitFunctionCallInfoData, InvalidOid, LOCAL_FCINFO, AttStatsSlot::numbers, AttStatsSlot::nvalues, statistic_proc_security_check(), VariableStatData::statsTuple, and AttStatsSlot::values.
Referenced by generic_restriction_selectivity(), networksel(), patternsel_common(), and scalarineqsel().
void mergejoinscansel | ( | PlannerInfo * | root, |
Node * | clause, | ||
Oid | opfamily, | ||
int | strategy, | ||
bool | nulls_first, | ||
Selectivity * | leftstart, | ||
Selectivity * | leftend, | ||
Selectivity * | rightstart, | ||
Selectivity * | rightend | ||
) |
Definition at line 2956 of file selfuncs.c.
References Assert, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, CLAMP_PROBABILITY, DEFAULT_INEQ_SEL, examine_variable(), get_leftop(), get_op_opfamily_properties(), get_opfamily_member(), get_rightop(), get_variable_range(), GETSTRUCT(), HeapTupleIsValid, is_opclause(), OidIsValid, ReleaseVariableStats, root, scalarineqsel(), and VariableStatData::statsTuple.
Referenced by cached_scansel().
Selectivity nulltestsel | ( | PlannerInfo * | root, |
NullTestType | nulltesttype, | ||
Node * | arg, | ||
int | varRelid, | ||
JoinType | jointype, | ||
SpecialJoinInfo * | sjinfo | ||
) |
Definition at line 1699 of file selfuncs.c.
References arg, CLAMP_PROBABILITY, DEFAULT_NOT_UNK_SEL, DEFAULT_UNK_SEL, elog, ERROR, examine_variable(), GETSTRUCT(), HeapTupleIsValid, IS_NOT_NULL, IS_NULL, IsA, ReleaseVariableStats, root, VariableStatData::statsTuple, and VariableStatData::var.
Referenced by clause_selectivity_ext(), and clauselist_selectivity_ext().
Selectivity rowcomparesel | ( | PlannerInfo * | root, |
RowCompareExpr * | clause, | ||
int | varRelid, | ||
JoinType | jointype, | ||
SpecialJoinInfo * | sjinfo | ||
) |
Definition at line 2206 of file selfuncs.c.
References join_selectivity(), RowCompareExpr::largs, linitial, linitial_oid, list_make2, NumRelids(), RowCompareExpr::rargs, restriction_selectivity(), root, and s1.
Referenced by clause_selectivity_ext().
Selectivity scalararraysel | ( | PlannerInfo * | root, |
ScalarArrayOpExpr * | clause, | ||
bool | is_join_clause, | ||
int | varRelid, | ||
JoinType | jointype, | ||
SpecialJoinInfo * | sjinfo | ||
) |
Definition at line 1817 of file selfuncs.c.
References generate_unaccent_rules::args, ScalarArrayOpExpr::args, ARR_ELEMTYPE, Assert, CLAMP_PROBABILITY, DatumGetArrayTypeP, DatumGetFloat8(), deconstruct_array(), ArrayExpr::elements, TypeCacheEntry::eq_opr, estimate_expression_value(), exprCollation(), exprType(), fmgr_info(), FunctionCall4Coll(), FunctionCall5Coll(), get_base_element_type(), get_negator(), get_oprjoin(), get_oprrest(), get_typlenbyval(), get_typlenbyvalalign(), i, Int16GetDatum(), Int32GetDatum(), IsA, lfirst, linitial, list_length(), list_make2, lookup_type_cache(), lsecond, makeConst(), makeNode, ObjectIdGetDatum(), OidIsValid, ScalarArrayOpExpr::opno, PointerGetDatum(), root, s1, s2, scalararraysel_containment(), strip_array_coercion(), TYPECACHE_EQ_OPR, CaseTestExpr::typeId, and ScalarArrayOpExpr::useOr.
Referenced by clause_selectivity_ext().
Selectivity scalararraysel_containment | ( | PlannerInfo * | root, |
Node * | leftop, | ||
Node * | rightop, | ||
Oid | elemtype, | ||
bool | isEquality, | ||
bool | useOr, | ||
int | varRelid | ||
) |
Definition at line 81 of file array_selfuncs.c.
References ATTSTATSSLOT_NUMBERS, ATTSTATSSLOT_VALUES, CLAMP_PROBABILITY, TypeCacheEntry::cmp_proc_finfo, examine_variable(), FmgrInfo::fn_oid, free_attstatsslot(), get_attstatsslot(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, IsA, lookup_type_cache(), mcelem_array_contain_overlap_selec(), mcelem_array_contained_selec(), AttStatsSlot::nnumbers, AttStatsSlot::numbers, AttStatsSlot::nvalues, OidIsValid, VariableStatData::rel, ReleaseVariableStats, root, statistic_proc_security_check(), VariableStatData::statsTuple, TYPECACHE_CMP_PROC_FINFO, and AttStatsSlot::values.
Referenced by scalararraysel().
bool statistic_proc_security_check | ( | VariableStatData * | vardata, |
Oid | func_oid | ||
) |
Definition at line 5769 of file selfuncs.c.
References VariableStatData::acl_ok, DEBUG2, ereport, errmsg_internal(), get_func_leakproof(), get_func_name(), and OidIsValid.
Referenced by calc_arraycontsel(), calc_hist_selectivity(), eqjoinsel(), get_variable_range(), histogram_selectivity(), ineq_histogram_selectivity(), mcv_selectivity(), scalararraysel_containment(), and var_eq_const().
double var_eq_const | ( | VariableStatData * | vardata, |
Oid | oproid, | ||
Oid | collation, | ||
Datum | constval, | ||
bool | constisnull, | ||
bool | varonleft, | ||
bool | negate | ||
) |
Definition at line 296 of file selfuncs.c.
References ATTSTATSSLOT_NUMBERS, ATTSTATSSLOT_VALUES, CLAMP_PROBABILITY, DatumGetBool(), fmgr_info(), free_attstatsslot(), FunctionCallInvoke, get_attstatsslot(), get_opcode(), get_variable_numdistinct(), GETSTRUCT(), HeapTupleIsValid, i, InitFunctionCallInfoData, InvalidOid, VariableStatData::isunique, LOCAL_FCINFO, AttStatsSlot::nnumbers, AttStatsSlot::numbers, AttStatsSlot::nvalues, VariableStatData::rel, statistic_proc_security_check(), VariableStatData::statsTuple, RelOptInfo::tuples, and AttStatsSlot::values.
Referenced by boolvarsel(), eqsel_internal(), patternsel_common(), and prefix_selectivity().
double var_eq_non_const | ( | VariableStatData * | vardata, |
Oid | oproid, | ||
Oid | collation, | ||
Node * | other, | ||
bool | varonleft, | ||
bool | negate | ||
) |
Definition at line 467 of file selfuncs.c.
References ATTSTATSSLOT_NUMBERS, CLAMP_PROBABILITY, free_attstatsslot(), get_attstatsslot(), get_variable_numdistinct(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, VariableStatData::isunique, AttStatsSlot::nnumbers, AttStatsSlot::numbers, VariableStatData::rel, VariableStatData::statsTuple, and RelOptInfo::tuples.
Referenced by eqsel_internal().
|
extern |
Definition at line 149 of file selfuncs.c.
Referenced by brincostestimate(), btcostestimate(), and examine_variable().
|
extern |
Definition at line 148 of file selfuncs.c.
Referenced by brincostestimate(), btcostestimate(), and examine_simple_variable().