#include "postgres.h"
#include <math.h>
#include "catalog/pg_statistic_ext.h"
#include "catalog/pg_statistic_ext_data.h"
#include "lib/stringinfo.h"
#include "statistics/extended_stats_internal.h"
#include "statistics/statistics.h"
#include "utils/fmgrprotos.h"
#include "utils/syscache.h"
#include "utils/typcache.h"
#include "varatt.h"
Go to the source code of this file.
Definition at line 52 of file mvdistinct.c.
Definition at line 55 of file mvdistinct.c.
Definition at line 45 of file mvdistinct.c.
Definition at line 48 of file mvdistinct.c.
Definition at line 521 of file mvdistinct.c.
References f1.
Referenced by ndistinct_for_combination().
Definition at line 692 of file mvdistinct.c.
References generate_combinations_recurse(), palloc0(), and pfree().
Referenced by generator_init().
Definition at line 657 of file mvdistinct.c.
References generate_combinations_recurse(), i, and start.
Referenced by generate_combinations(), and generate_combinations_recurse().
Definition at line 642 of file mvdistinct.c.
References pfree().
Referenced by statext_ndistinct_build().
Definition at line 589 of file mvdistinct.c.
References Assert(), generate_combinations(), n_choose_k(), and palloc().
Referenced by statext_ndistinct_build().
Definition at line 627 of file mvdistinct.c.
Referenced by statext_ndistinct_build().
Definition at line 550 of file mvdistinct.c.
Referenced by generator_init().
Definition at line 425 of file mvdistinct.c.
References VacAttrStats::attrcollid, VacAttrStats::attrtypid, collid, data, elog, ERROR, estimate_ndistinct(), f1, i, InvalidOid, items, j, lookup_type_cache(), multi_sort_add_dimension(), multi_sort_compare(), multi_sort_init(), palloc(), palloc0(), qsort_interruptible(), type, TYPECACHE_LT_OPR, and values.
Referenced by statext_ndistinct_build().
Definition at line 575 of file mvdistinct.c.
Referenced by statext_ndistinct_build().
Definition at line 339 of file mvdistinct.c.
References ereport, errcode(), errmsg(), ERROR, and PG_RETURN_VOID.
Definition at line 355 of file mvdistinct.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), attnum, MVNDistinctItem::attributes, data, i, initStringInfo(), MVNDistinct::items, j, MVNDistinctItem::nattributes, MVNDistinctItem::ndistinct, MVNDistinct::nitems, PG_GETARG_BYTEA_PP, PG_RETURN_CSTRING, statext_ndistinct_deserialize(), and str.
Definition at line 392 of file mvdistinct.c.
References ereport, errcode(), errmsg(), ERROR, and PG_RETURN_VOID.
Definition at line 88 of file mvdistinct.c.
References Assert(), AttributeNumberIsValid, MVNDistinctItem::attributes, data, generator_free(), generator_init(), generator_next(), MVNDistinct::items, items, j, MVNDistinct::magic, MVNDistinctItem::nattributes, MVNDistinctItem::ndistinct, ndistinct_for_combination(), MVNDistinct::nitems, nitems, num_combinations(), palloc(), STATS_NDISTINCT_MAGIC, STATS_NDISTINCT_TYPE_BASIC, and MVNDistinct::type.
Referenced by BuildRelationExtStatistics().
Definition at line 250 of file mvdistinct.c.
References Assert(), MVNDistinctItem::attributes, data, elog, ERROR, i, MVNDistinct::items, items, MVNDistinct::magic, MAXALIGN, MinSizeOfItems, MVNDistinctItem::nattributes, MVNDistinctItem::ndistinct, MVNDistinct::nitems, palloc(), palloc0(), SizeOfHeader, STATS_MAX_DIMENSIONS, STATS_NDISTINCT_MAGIC, STATS_NDISTINCT_TYPE_BASIC, MVNDistinct::type, VARDATA_ANY(), VARSIZE_ANY(), and VARSIZE_ANY_EXHDR().
Referenced by pg_ndistinct_out(), and statext_ndistinct_load().
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().
Definition at line 179 of file mvdistinct.c.
References Assert(), MVNDistinctItem::attributes, i, MVNDistinct::items, len, MVNDistinct::magic, MVNDistinctItem::nattributes, MVNDistinctItem::ndistinct, MVNDistinct::nitems, output, palloc(), SET_VARSIZE(), SizeOfHeader, SizeOfItem, STATS_NDISTINCT_MAGIC, STATS_NDISTINCT_TYPE_BASIC, MVNDistinct::type, VARDATA(), and VARHDRSZ.
Referenced by statext_store().