|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/htup_details.h"#include "catalog/pg_statistic_ext.h"#include "catalog/pg_statistic_ext_data.h"#include "nodes/nodeFuncs.h"#include "optimizer/clauses.h"#include "optimizer/optimizer.h"#include "parser/parsetree.h"#include "statistics/extended_stats_internal.h"#include "utils/fmgroids.h"#include "utils/lsyscache.h"#include "utils/memutils.h"#include "utils/selfuncs.h"#include "utils/syscache.h"#include "utils/typcache.h"
Go to the source code of this file.
Data Structures | |
| struct | DependencyGeneratorData |
Macros | |
| #define | SizeOfHeader (3 * sizeof(uint32)) |
| #define | SizeOfItem(natts) (sizeof(double) + sizeof(AttrNumber) * (1 + (natts))) |
| #define | MinSizeOfItem SizeOfItem(2) |
| #define | MinSizeOfItems(ndeps) (SizeOfHeader + (ndeps) * MinSizeOfItem) |
Typedefs | |
| typedef struct DependencyGeneratorData | DependencyGeneratorData |
| typedef DependencyGeneratorData * | DependencyGenerator |
| #define MinSizeOfItem SizeOfItem(2) |
Definition at line 39 of file dependencies.c.
| #define MinSizeOfItems | ( | ndeps | ) | (SizeOfHeader + (ndeps) * MinSizeOfItem) |
Definition at line 42 of file dependencies.c.
| #define SizeOfHeader (3 * sizeof(uint32)) |
Definition at line 32 of file dependencies.c.
| #define SizeOfItem | ( | natts | ) | (sizeof(double) + sizeof(AttrNumber) * (1 + (natts))) |
Definition at line 35 of file dependencies.c.
Definition at line 59 of file dependencies.c.
| typedef struct DependencyGeneratorData DependencyGeneratorData |
|
static |
Definition at line 923 of file dependencies.c.
References attnum, MVDependency::attributes, bms_add_member(), bms_free(), bms_member_index(), bms_next_member(), bms_num_members(), CLAMP_PROBABILITY, clauselist_selectivity_ext(), MVDependency::degree, i, j, lappend(), lfirst, MVDependency::nattributes, NIL, palloc(), pfree(), root, s1, and s2.
Referenced by dependencies_clauselist_selectivity().
| Selectivity dependencies_clauselist_selectivity | ( | PlannerInfo * | root, |
| List * | clauses, | ||
| int | varRelid, | ||
| JoinType | jointype, | ||
| SpecialJoinInfo * | sjinfo, | ||
| RelOptInfo * | rel, | ||
| Bitmapset ** | estimatedclauses | ||
| ) |
Definition at line 1279 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().
|
static |
Definition at line 215 of file dependencies.c.
References Assert(), VacAttrStats::attrcollid, VacAttrStats::attrtypid, build_sorted_items(), data, elog, ERROR, for(), i, InvalidOid, items, lookup_type_cache(), multi_sort_add_dimension(), multi_sort_compare_dim(), multi_sort_compare_dims(), multi_sort_init(), nitems, palloc(), type, and TYPECACHE_LT_OPR.
Referenced by statext_dependencies_build().
|
static |
Definition at line 650 of file dependencies.c.
References OpExpr::args, ScalarArrayOpExpr::args, BoolExpr::args, attnum, AttrNumberIsForUserDefinedAttr, bms_membership(), BMS_SINGLETON, RestrictInfo::clause, dependency_is_compatible_clause(), get_notclausearg(), get_oprrest(), InvalidAttrNumber, is_notclause(), is_opclause(), is_orclause(), is_pseudo_constant_clause(), IsA, lfirst, linitial, list_length(), lsecond, OpExpr::opno, ScalarArrayOpExpr::opno, ScalarArrayOpExpr::useOr, Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by dependencies_clauselist_selectivity(), and dependency_is_compatible_clause().
|
static |
Definition at line 1077 of file dependencies.c.
References OpExpr::args, ScalarArrayOpExpr::args, BoolExpr::args, bms_membership(), BMS_SINGLETON, RestrictInfo::clause, dependency_is_compatible_expression(), equal(), StatisticExtInfo::exprs, get_notclausearg(), get_oprrest(), is_notclause(), is_opclause(), is_orclause(), is_pseudo_constant_clause(), IsA, StatisticExtInfo::kind, lfirst, linitial, list_length(), lsecond, OpExpr::opno, ScalarArrayOpExpr::opno, and ScalarArrayOpExpr::useOr.
Referenced by dependencies_clauselist_selectivity(), and dependency_is_compatible_expression().
|
static |
Definition at line 589 of file dependencies.c.
References attnum, MVDependency::attributes, bms_is_member(), j, and MVDependency::nattributes.
Referenced by find_strongest_dependency().
|
static |
Definition at line 190 of file dependencies.c.
References pfree().
Referenced by statext_dependencies_build().
|
static |
Definition at line 167 of file dependencies.c.
References Assert(), generate_dependencies(), palloc(), and palloc0().
Referenced by statext_dependencies_build().
|
static |
Definition at line 198 of file dependencies.c.
Referenced by statext_dependencies_build().
|
static |
Definition at line 838 of file dependencies.c.
References bms_num_members(), MVDependency::degree, dependency_is_fully_matched(), MVDependencies::deps, i, j, MVDependency::nattributes, and MVDependencies::ndeps.
Referenced by dependencies_clauselist_selectivity().
|
static |
Definition at line 151 of file dependencies.c.
References generate_dependencies_recurse(), palloc0(), and pfree().
Referenced by DependencyGenerator_init().
|
static |
Definition at line 85 of file dependencies.c.
References generate_dependencies_recurse(), i, j, repalloc(), and start.
Referenced by generate_dependencies(), and generate_dependencies_recurse().
| MVDependencies * statext_dependencies_build | ( | StatsBuildData * | data | ) |
Definition at line 342 of file dependencies.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert(), MVDependency::attributes, CurrentMemoryContext, data, MVDependency::degree, dependency_degree(), DependencyGenerator_free(), DependencyGenerator_init(), DependencyGenerator_next(), MVDependencies::deps, i, if(), MVDependencies::magic, MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), MVDependency::nattributes, MVDependencies::ndeps, palloc0(), repalloc(), STATS_DEPS_MAGIC, STATS_DEPS_TYPE_BASIC, and MVDependencies::type.
Referenced by BuildRelationExtStatistics().
| MVDependencies * statext_dependencies_deserialize | ( | bytea * | data | ) |
Definition at line 493 of file dependencies.c.
References Assert(), MVDependency::attributes, data, MVDependency::degree, MVDependencies::deps, elog, ERROR, i, MVDependencies::magic, MVDependency::nattributes, MVDependencies::ndeps, palloc0(), repalloc(), SizeOfHeader, SizeOfItem, STATS_DEPS_MAGIC, STATS_DEPS_TYPE_BASIC, STATS_MAX_DIMENSIONS, MVDependencies::type, VARDATA_ANY(), VARSIZE_ANY(), and VARSIZE_ANY_EXHDR().
Referenced by pg_dependencies_out(), and statext_dependencies_load().
| MVDependencies * statext_dependencies_load | ( | Oid | mvoid, |
| bool | inh | ||
| ) |
Definition at line 613 of file dependencies.c.
References BoolGetDatum(), DatumGetByteaPP, elog, ERROR, HeapTupleIsValid, ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache2(), statext_dependencies_deserialize(), and SysCacheGetAttr().
Referenced by dependencies_clauselist_selectivity().
| bytea * statext_dependencies_serialize | ( | MVDependencies * | dependencies | ) |
Definition at line 438 of file dependencies.c.
References Assert(), MVDependency::attributes, MVDependency::degree, MVDependencies::deps, i, len, MVDependencies::magic, MVDependency::nattributes, MVDependencies::ndeps, output, palloc0(), SET_VARSIZE(), SizeOfHeader, SizeOfItem, MVDependencies::type, VARDATA(), and VARHDRSZ.
Referenced by build_mvdependencies(), and statext_store().