|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/heapam.h"#include "catalog/indexing.h"#include "catalog/namespace.h"#include "catalog/pg_operator.h"#include "nodes/makefuncs.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.
Variables | |
| static struct StatsArgInfo | attarginfo [] |
| static struct StatsArgInfo | cleararginfo [] |
Definition at line 38 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 89 of file attribute_stats.c.
|
static |
Definition at line 134 of file attribute_stats.c.
References attarginfo, attname, ATTNAME_ARG, attnum, ATTNUM_ARG, ATTRELNAME_ARG, ATTRELSCHEMA_ARG, attribute_statistics_update_internal(), ereport, errcode(), errhint(), errmsg, ERROR, fb(), get_attname(), get_attnum(), INHERITED_ARG, InvalidAttrNumber, InvalidOid, makeRangeVar(), PG_ARGISNULL, PG_GETARG_BOOL, PG_GETARG_DATUM, PG_GETARG_INT16, RangeVarCallbackForStats(), RangeVarGetRelidExtended(), RecoveryInProgress(), relname, SearchSysCacheExistsAttName(), ShareUpdateExclusiveLock, stats_check_required_arg(), and TextDatumGetCString.
Referenced by pg_restore_attribute_stats().
|
static |
Definition at line 215 of file attribute_stats.c.
References ARR_DIMS, attarginfo, attname, attnum, AVG_WIDTH_ARG, BoolGetDatum(), construct_array_builtin(), CORRELATION_ARG, DatumGetArrayTypeP, ELEM_COUNT_HISTOGRAM_ARG, ereport, errcode(), errdetail(), errmsg, fb(), fmgr_info(), heap_deform_tuple(), HeapTupleIsValid, HISTOGRAM_BOUNDS_ARG, Int16GetDatum(), 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_DATUM, PointerGetDatum, RANGE_BOUNDS_HISTOGRAM_ARG, RANGE_EMPTY_FRAC_ARG, RANGE_LENGTH_HISTOGRAM_ARG, RelationGetDescr, ReleaseSysCache(), result, RowExclusiveLock, SearchSysCache3(), statatt_build_stavalues(), statatt_check_bounds_histogram(), statatt_get_elem_type(), statatt_get_type(), statatt_init_empty_tuple(), statatt_set_slot(), stats_check_arg_array(), stats_check_arg_pair(), table_close(), table_open(), upsert_pg_statistic(), values, and WARNING.
Referenced by attribute_statistics_update(), and import_attribute_statistics().
| bool delete_attribute_statistics | ( | Relation | rel, |
| AttrNumber | attnum, | ||
| bool | inherited | ||
| ) |
Definition at line 798 of file attribute_stats.c.
References attnum, delete_pg_statistic(), fb(), and RelationGetRelid.
Referenced by import_fetched_statistics().
|
static |
Definition at line 586 of file attribute_stats.c.
References attnum, BoolGetDatum(), CatalogTupleDelete(), CommandCounterIncrement(), fb(), HeapTupleIsValid, Int16GetDatum(), ObjectIdGetDatum(), ReleaseSysCache(), result, RowExclusiveLock, SearchSysCache3(), table_close(), and table_open().
Referenced by delete_attribute_statistics(), and pg_clear_attribute_stats().
| bool import_attribute_statistics | ( | Relation | rel, |
| AttrNumber | attnum, | ||
| bool | inherited, | ||
| const NullableDatum * | version, | ||
| const NullableDatum * | null_frac, | ||
| const NullableDatum * | avg_width, | ||
| const NullableDatum * | n_distinct, | ||
| const NullableDatum * | most_common_vals, | ||
| const NullableDatum * | most_common_freqs, | ||
| const NullableDatum * | histogram_bounds, | ||
| const NullableDatum * | correlation, | ||
| const NullableDatum * | most_common_elems, | ||
| const NullableDatum * | most_common_elem_freqs, | ||
| const NullableDatum * | elem_count_histogram, | ||
| const NullableDatum * | range_length_histogram, | ||
| const NullableDatum * | range_empty_frac, | ||
| const NullableDatum * | range_bounds_histogram | ||
| ) |
Definition at line 718 of file attribute_stats.c.
References Assert, attname, ATTNAME_ARG, attnum, ATTNUM_ARG, ATTRELNAME_ARG, ATTRELSCHEMA_ARG, attribute_statistics_update_internal(), AVG_WIDTH_ARG, BoolGetDatum(), CORRELATION_ARG, CStringGetTextDatum, ELEM_COUNT_HISTOGRAM_ARG, ereport, errcode(), errmsg, ERROR, fb(), get_attname(), get_namespace_name(), HISTOGRAM_BOUNDS_ARG, INHERITED_ARG, InitFunctionCallInfoData, Int16GetDatum(), InvalidOid, LOCAL_FCINFO, MOST_COMMON_ELEM_FREQS_ARG, MOST_COMMON_ELEMS_ARG, MOST_COMMON_FREQS_ARG, MOST_COMMON_VALS_ARG, N_DISTINCT_ARG, NULL_FRAC_ARG, NUM_ATTRIBUTE_STATS_ARGS, RANGE_BOUNDS_HISTOGRAM_ARG, RANGE_EMPTY_FRAC_ARG, RANGE_LENGTH_HISTOGRAM_ARG, RelationGetNamespace, RelationGetRelationName, RelationGetRelid, relname, and SearchSysCacheExistsAttName().
Referenced by import_fetched_statistics().
| Datum pg_clear_attribute_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 616 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, fb(), get_attnum(), get_rel_name(), InvalidAttrNumber, InvalidOid, makeRangeVar(), PG_GETARG_BOOL, PG_GETARG_DATUM, PG_RETURN_VOID, RangeVarCallbackForStats(), RangeVarGetRelidExtended(), RecoveryInProgress(), relname, ShareUpdateExclusiveLock, stats_check_required_arg(), and TextDatumGetCString.
| Datum pg_restore_attribute_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 692 of file attribute_stats.c.
References attarginfo, attribute_statistics_update(), fb(), InitFunctionCallInfoData, InvalidOid, LOCAL_FCINFO, NUM_ATTRIBUTE_STATS_ARGS, PG_RETURN_BOOL, result, and stats_fill_fcinfo_from_arg_pairs().
|
static |
Definition at line 560 of file attribute_stats.c.
References CatalogTupleInsert(), CatalogTupleUpdate(), CommandCounterIncrement(), fb(), heap_form_tuple(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, RelationGetDescr, and values.
Referenced by attribute_statistics_update_internal().
|
static |
Definition at line 61 of file attribute_stats.c.
Referenced by attribute_statistics_update(), attribute_statistics_update_internal(), and pg_restore_attribute_stats().
|
static |
Definition at line 98 of file attribute_stats.c.
Referenced by pg_clear_attribute_stats().