#include "postgres.h"
#include "access/heapam.h"
#include "catalog/indexing.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_operator.h"
#include "nodes/nodeFuncs.h"
#include "statistics/statistics.h"
#include "statistics/stat_utils.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
Go to the source code of this file.
Definition at line 34 of file attribute_stats.c.
Definition at line 35 of file attribute_stats.c.
Definition at line 33 of file attribute_stats.c.
Definition at line 37 of file attribute_stats.c.
Enumerator | |
---|---|
C_ATTRELSCHEMA_ARG | |
C_ATTRELNAME_ARG | |
C_ATTNAME_ARG | |
C_INHERITED_ARG | |
C_NUM_ATTRIBUTE_STATS_ARGS |
Definition at line 83 of file attribute_stats.c.
Definition at line 138 of file attribute_stats.c.
References attarginfo, attname, ATTNAME_ARG, attnum, ATTNUM_ARG, ATTRELNAME_ARG, ATTRELSCHEMA_ARG, AVG_WIDTH_ARG, BoolGetDatum(), construct_array_builtin(), CORRELATION_ARG, ELEM_COUNT_HISTOGRAM_ARG, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, fmgr_info(), get_attname(), get_attnum(), get_attr_stat_type(), get_elem_stat_type(), heap_deform_tuple(), HeapTupleIsValid, HISTOGRAM_BOUNDS_ARG, INHERITED_ARG, init_empty_stats_tuple(), Int16GetDatum(), InvalidAttrNumber, InvalidOid, MOST_COMMON_ELEM_FREQS_ARG, MOST_COMMON_ELEMS_ARG, MOST_COMMON_FREQS_ARG, MOST_COMMON_VALS_ARG, N_DISTINCT_ARG, NULL_FRAC_ARG, ObjectIdGetDatum(), OidIsValid, PG_ARGISNULL, PG_GETARG_BOOL, PG_GETARG_DATUM, PG_GETARG_INT16, PointerGetDatum(), RANGE_BOUNDS_HISTOGRAM_ARG, RANGE_EMPTY_FRAC_ARG, RANGE_LENGTH_HISTOGRAM_ARG, RecoveryInProgress(), RelationGetDescr, ReleaseSysCache(), relname, RowExclusiveLock, SearchSysCache3(), SearchSysCacheExistsAttName(), set_stats_slot(), stats_check_arg_array(), stats_check_arg_pair(), stats_check_required_arg(), stats_lock_check_privileges(), stats_lookup_relid(), table_close(), table_open(), text_to_stavalues(), TextDatumGetCString, upsert_pg_statistic(), values, and WARNING.
Referenced by pg_restore_attribute_stats().
Definition at line 844 of file attribute_stats.c.
References attnum, BoolGetDatum(), CatalogTupleDelete(), CommandCounterIncrement(), HeapTupleIsValid, Int16GetDatum(), ObjectIdGetDatum(), ReleaseSysCache(), RowExclusiveLock, SearchSysCache3(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by pg_clear_attribute_stats().
Definition at line 536 of file attribute_stats.c.
References attnum, elog, ERROR, i, lfirst, list_head(), lnext(), NIL, RelationData::rd_index, RelationData::rd_indexprs, RelationData::rd_rel, and RelationGetIndexExpressions().
Referenced by get_attr_stat_type().
Definition at line 575 of file attribute_stats.c.
References AccessShareLock, attnum, TypeCacheEntry::eq_opr, ereport, errcode(), errmsg(), ERROR, exprCollation(), exprType(), exprTypmod(), get_attr_expr(), get_multirange_range(), GETSTRUCT(), HeapTupleIsValid, Int16GetDatum(), lookup_type_cache(), TypeCacheEntry::lt_opr, NoLock, ObjectIdGetDatum(), OidIsValid, relation_close(), relation_open(), RelationGetRelationName, ReleaseSysCache(), SearchSysCache2(), type_is_multirange(), TYPECACHE_EQ_OPR, TYPECACHE_LT_OPR, and TypeCacheEntry::typtype.
Referenced by attribute_statistics_update().
Definition at line 657 of file attribute_stats.c.
References TypeCacheEntry::eq_opr, get_base_element_type(), lookup_type_cache(), OidIsValid, and TYPECACHE_EQ_OPR.
Referenced by attribute_statistics_update().
Definition at line 874 of file attribute_stats.c.
References attnum, BoolGetDatum(), DEFAULT_AVG_WIDTH, DEFAULT_N_DISTINCT, DEFAULT_NULL_FRAC, Int16GetDatum(), InvalidOid, ObjectIdGetDatum(), STATISTIC_NUM_SLOTS, and values.
Referenced by attribute_statistics_update().
Definition at line 912 of file attribute_stats.c.
References attname, attnum, C_ATTNAME_ARG, C_ATTRELNAME_ARG, C_ATTRELSCHEMA_ARG, C_INHERITED_ARG, cleararginfo, delete_pg_statistic(), ereport, errcode(), errhint(), errmsg(), ERROR, get_attnum(), get_rel_name(), InvalidAttrNumber, PG_GETARG_BOOL, PG_GETARG_DATUM, PG_RETURN_VOID, RecoveryInProgress(), relname, stats_check_required_arg(), stats_lock_check_privileges(), stats_lookup_relid(), and TextDatumGetCString.
Definition at line 987 of file attribute_stats.c.
References attarginfo, attribute_statistics_update(), InitFunctionCallInfoData, InvalidOid, LOCAL_FCINFO, NUM_ATTRIBUTE_STATS_ARGS, PG_RETURN_BOOL, and stats_fill_fcinfo_from_arg_pairs().
Definition at line 750 of file attribute_stats.c.
References DatumGetInt16(), DatumGetObjectId(), ereport, errmsg(), ERROR, Int16GetDatum(), ObjectIdGetDatum(), STATISTIC_NUM_SLOTS, and values.
Referenced by attribute_statistics_update().
Definition at line 697 of file attribute_stats.c.
References array_contains_nulls(), array_in(), CStringGetDatum(), DatumGetArrayTypeP, ErrorSaveContext::details_wanted, ErrorData::elevel, ereport, errcode(), errmsg(), ErrorSaveContext::error_data, ErrorSaveContext::error_occurred, FunctionCallInvoke, InitFunctionCallInfoData, Int32GetDatum(), InvalidOid, LOCAL_FCINFO, ObjectIdGetDatum(), pfree(), TextDatumGetCString, ThrowErrorData(), and WARNING.
Referenced by attribute_statistics_update().
Definition at line 818 of file attribute_stats.c.
References CatalogTupleInsert(), CatalogTupleUpdate(), CommandCounterIncrement(), heap_form_tuple(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, RelationGetDescr, HeapTupleData::t_self, and values.
Referenced by attribute_statistics_update().
Definition at line 60 of file attribute_stats.c.
Referenced by attribute_statistics_update(), and pg_restore_attribute_stats().
Definition at line 92 of file attribute_stats.c.
Referenced by pg_clear_attribute_stats().