1/*-------------------------------------------------------------------------
4 * definition of the "extended statistics" system catalog
7 * Note that pg_statistic_ext contains the definitions of extended statistics
8 * objects, created by CREATE STATISTICS, but not the actual statistical data,
9 * created by running ANALYZE.
11 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
12 * Portions Copyright (c) 1994, Regents of the University of California
14 * src/include/catalog/pg_statistic_ext.h
17 * The Catalog.pm module reads this file and derives schema
20 *-------------------------------------------------------------------------
22#ifndef PG_STATISTIC_EXT_H
23#define PG_STATISTIC_EXT_H
26#include "catalog/pg_statistic_ext_d.h" /* IWYU pragma: export */
29 * pg_statistic_ext definition. cpp turns this into
30 * typedef struct FormData_pg_statistic_ext
33 CATALOG(pg_statistic_ext,3381,StatisticExtRelationId)
40 /* These two fields form the unique key for the entry: */
41 NameData stxname;
/* statistics object name */
42 Oid stxnamespace
BKI_LOOKUP(pg_namespace);
/* OID of statistics
43 * object's namespace */
45 Oid stxowner
BKI_LOOKUP(pg_authid);
/* statistics object's owner */
48 * variable-length/nullable fields start here, but we allow direct access
57 pg_node_tree stxexprs;
/* A list of expression trees for stats
58 * attributes that are not simple column
65 * Form_pg_statistic_ext corresponds to a pointer to a tuple with
66 * the format of pg_statistic_ext relation.
74 DECLARE_UNIQUE_INDEX(pg_statistic_ext_name_index, 3997, StatisticExtNameIndexId, pg_statistic_ext, btree(stxname name_ops, stxnamespace oid_ops));
75 DECLARE_INDEX(pg_statistic_ext_relid_index, 3379, StatisticExtRelidIndexId, pg_statistic_ext, btree(stxrelid oid_ops));
82#ifdef EXPOSE_TO_CLIENT_CODE
84#define STATS_EXT_NDISTINCT 'd'
85#define STATS_EXT_DEPENDENCIES 'f'
86#define STATS_EXT_MCV 'm'
87#define STATS_EXT_EXPRESSIONS 'e'
89#endif /* EXPOSE_TO_CLIENT_CODE */
91#endif /* PG_STATISTIC_EXT_H */
#define BKI_LOOKUP(catalog)
#define BKI_DEFAULT(value)
#define BKI_FORCE_NOT_NULL
MAKE_SYSCACHE(STATEXTOID, pg_statistic_ext_oid_index, 4)
DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_ext_oid_index, 3380, StatisticExtOidIndexId, pg_statistic_ext, btree(oid oid_ops))
FormData_pg_statistic_ext * Form_pg_statistic_ext
DECLARE_UNIQUE_INDEX(pg_statistic_ext_name_index, 3997, StatisticExtNameIndexId, pg_statistic_ext, btree(stxname name_ops, stxnamespace oid_ops))
CATALOG(pg_statistic_ext, 3381, StatisticExtRelationId)
DECLARE_TOAST(pg_statistic_ext, 3439, 3440)
DECLARE_ARRAY_FOREIGN_KEY((stxrelid, stxkeys), pg_attribute,(attrelid, attnum))
FormData_pg_statistic_ext
DECLARE_INDEX(pg_statistic_ext_relid_index, 3379, StatisticExtRelidIndexId, pg_statistic_ext, btree(stxrelid oid_ops))