PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | MVNDistinctItem |
struct | MVNDistinct |
struct | MVDependency |
struct | MVDependencies |
struct | MCVItem |
struct | MCVList |
Macros | |
#define | STATS_MAX_DIMENSIONS 8 /* max number of attributes */ |
#define | STATS_NDISTINCT_MAGIC 0xA352BFA4 /* struct identifier */ |
#define | STATS_NDISTINCT_TYPE_BASIC 1 /* struct version */ |
#define | STATS_DEPS_MAGIC 0xB4549A2C /* marks serialized bytea */ |
#define | STATS_DEPS_TYPE_BASIC 1 /* basic dependencies type */ |
#define | STATS_MCV_MAGIC 0xE1A651C2 /* marks serialized bytea */ |
#define | STATS_MCV_TYPE_BASIC 1 /* basic MCV list type */ |
#define | STATS_MCVLIST_MAX_ITEMS MAX_STATISTICS_TARGET |
Typedefs | |
typedef struct MVNDistinctItem | MVNDistinctItem |
typedef struct MVNDistinct | MVNDistinct |
typedef struct MVDependency | MVDependency |
typedef struct MVDependencies | MVDependencies |
typedef struct MCVItem | MCVItem |
typedef struct MCVList | MCVList |
#define STATS_DEPS_MAGIC 0xB4549A2C /* marks serialized bytea */ |
Definition at line 43 of file statistics.h.
#define STATS_DEPS_TYPE_BASIC 1 /* basic dependencies type */ |
Definition at line 44 of file statistics.h.
#define STATS_MAX_DIMENSIONS 8 /* max number of attributes */ |
Definition at line 19 of file statistics.h.
#define STATS_MCV_MAGIC 0xE1A651C2 /* marks serialized bytea */ |
Definition at line 66 of file statistics.h.
#define STATS_MCV_TYPE_BASIC 1 /* basic MCV list type */ |
Definition at line 67 of file statistics.h.
#define STATS_MCVLIST_MAX_ITEMS MAX_STATISTICS_TARGET |
Definition at line 70 of file statistics.h.
#define STATS_NDISTINCT_MAGIC 0xA352BFA4 /* struct identifier */ |
Definition at line 22 of file statistics.h.
#define STATS_NDISTINCT_TYPE_BASIC 1 /* struct version */ |
Definition at line 23 of file statistics.h.
typedef struct MVDependencies MVDependencies |
typedef struct MVDependency MVDependency |
typedef struct MVNDistinct MVNDistinct |
typedef struct MVNDistinctItem MVNDistinctItem |
void BuildRelationExtStatistics | ( | Relation | onerel, |
bool | inh, | ||
double | totalrows, | ||
int | numrows, | ||
HeapTuple * | rows, | ||
int | natts, | ||
VacAttrStats ** | vacattrstats | ||
) |
Definition at line 112 of file extended_stats.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AmAutoVacuumWorkerProcess, bms_num_members(), build_expr_data(), compute_expr_stats(), CurrentMemoryContext, data, elog, ereport, errcode(), errmsg(), ERROR, errtable(), fetch_statentries_for_relation(), get_namespace_name(), lfirst, lfirst_int, list_free(), list_length(), lookup_var_attr_stats(), make_build_data(), MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), NIL, pgstat_progress_update_multi_param(), pgstat_progress_update_param(), PROGRESS_ANALYZE_EXT_STATS_COMPUTED, PROGRESS_ANALYZE_EXT_STATS_TOTAL, PROGRESS_ANALYZE_PHASE, PROGRESS_ANALYZE_PHASE_COMPUTE_EXT_STATS, RelationData::rd_rel, RelationGetRelationName, RelationGetRelid, RowExclusiveLock, serialize_expr_stats(), statext_compute_stattarget(), statext_dependencies_build(), statext_mcv_build(), statext_ndistinct_build(), statext_store(), table_close(), table_open(), val, and WARNING.
Referenced by do_analyze_rel().
StatisticExtInfo* choose_best_statistics | ( | List * | stats, |
char | requiredkind, | ||
bool | inh, | ||
Bitmapset ** | clause_attnums, | ||
List ** | clause_exprs, | ||
int | nclauses | ||
) |
Definition at line 1209 of file extended_stats.c.
References bms_add_members(), bms_free(), bms_is_subset(), bms_num_members(), StatisticExtInfo::exprs, i, StatisticExtInfo::inherit, StatisticExtInfo::keys, StatisticExtInfo::kind, lfirst, list_length(), stat_covers_expressions(), and STATS_MAX_DIMENSIONS.
Referenced by statext_mcv_clauselist_selectivity().
int ComputeExtStatisticsRows | ( | Relation | onerel, |
int | natts, | ||
VacAttrStats ** | vacattrstats | ||
) |
Definition at line 265 of file extended_stats.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, bms_num_members(), CurrentMemoryContext, fetch_statentries_for_relation(), lfirst, lookup_var_attr_stats(), MemoryContextDelete(), MemoryContextSwitchTo(), RelationGetRelid, RowExclusiveLock, statext_compute_stattarget(), table_close(), and table_open().
Referenced by do_analyze_rel().
Selectivity dependencies_clauselist_selectivity | ( | PlannerInfo * | root, |
List * | clauses, | ||
int | varRelid, | ||
JoinType | jointype, | ||
SpecialJoinInfo * | sjinfo, | ||
RelOptInfo * | rel, | ||
Bitmapset ** | estimatedclauses | ||
) |
Definition at line 1370 of file dependencies.c.
References Assert, attnum, AttributeNumberIsValid, MVDependency::attributes, AttrNumberIsForUserDefinedAttr, bms_add_member(), bms_del_member(), bms_free(), bms_is_member(), bms_membership(), BMS_MULTIPLE, bms_next_member(), clauselist_apply_dependencies(), dependency_is_compatible_clause(), dependency_is_compatible_expression(), MVDependencies::deps, equal(), find_strongest_dependency(), has_stats_of_kind(), i, idx(), RangeTblEntry::inh, InvalidAttrNumber, j, lfirst, list_length(), list_nth(), MaxHeapAttributeNumber, MVDependency::nattributes, MVDependencies::ndeps, NIL, palloc(), pfree(), planner_rt_fetch, RelOptInfo::relid, root, s1, skip, statext_dependencies_load(), and RelOptInfo::statlist.
Referenced by statext_clauselist_selectivity().
Definition at line 1118 of file extended_stats.c.
References lfirst.
Referenced by dependencies_clauselist_selectivity(), and statext_mcv_clauselist_selectivity().
Selectivity statext_clauselist_selectivity | ( | PlannerInfo * | root, |
List * | clauses, | ||
int | varRelid, | ||
JoinType | jointype, | ||
SpecialJoinInfo * | sjinfo, | ||
RelOptInfo * | rel, | ||
Bitmapset ** | estimatedclauses, | ||
bool | is_or | ||
) |
Definition at line 2004 of file extended_stats.c.
References dependencies_clauselist_selectivity(), root, and statext_mcv_clauselist_selectivity().
Referenced by clauselist_selectivity_ext(), and clauselist_selectivity_or().
MVDependencies* statext_dependencies_load | ( | Oid | mvoid, |
bool | inh | ||
) |
Definition at line 619 of file dependencies.c.
References BoolGetDatum(), DatumGetByteaPP, elog, ERROR, HeapTupleIsValid, ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache2(), statext_dependencies_deserialize(), and SysCacheGetAttr().
Referenced by dependencies_clauselist_selectivity().
Definition at line 2425 of file extended_stats.c.
References BoolGetDatum(), DatumGetExpandedArray(), DatumGetHeapTupleHeader, deconstruct_expanded_array(), ExpandedArrayHeader::dvalues, elog, ERROR, heap_copytuple(), HeapTupleHeaderGetDatumLength, HeapTupleIsValid, idx(), InvalidOid, ItemPointerSetInvalid(), ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache2(), SysCacheGetAttr(), HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, and value.
Referenced by examine_variable().
Definition at line 389 of file extended_stats.c.
References attnum, elog, ERROR, heap_attisnull(), and type.
Referenced by get_relation_statistics_worker().
Definition at line 558 of file mcv.c.
References BoolGetDatum(), DatumGetByteaP, elog, ERROR, HeapTupleIsValid, ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache2(), statext_mcv_deserialize(), and SysCacheGetAttr().
Referenced by mcv_clauselist_selectivity(), and statext_mcv_clauselist_selectivity().
MVNDistinct* statext_ndistinct_load | ( | Oid | mvoid, |
bool | inh | ||
) |
Definition at line 148 of file mvdistinct.c.
References BoolGetDatum(), DatumGetByteaPP, elog, ERROR, HeapTupleIsValid, ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache2(), statext_ndistinct_deserialize(), and SysCacheGetAttr().
Referenced by estimate_multivariate_ndistinct().