PostgreSQL Source Code git master
Loading...
Searching...
No Matches
pg_statistic_ext.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * pg_statistic_ext.h
4 * definition of the "extended statistics" system catalog
5 * (pg_statistic_ext)
6 *
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.
10 *
11 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
12 * Portions Copyright (c) 1994, Regents of the University of California
13 *
14 * src/include/catalog/pg_statistic_ext.h
15 *
16 * NOTES
17 * The Catalog.pm module reads this file and derives schema
18 * information.
19 *
20 *-------------------------------------------------------------------------
21 */
22#ifndef PG_STATISTIC_EXT_H
23#define PG_STATISTIC_EXT_H
24
25#include "catalog/genbki.h"
26#include "catalog/pg_statistic_ext_d.h" /* IWYU pragma: export */
27
28/* ----------------
29 * pg_statistic_ext definition. cpp turns this into
30 * typedef struct FormData_pg_statistic_ext
31 * ----------------
32 */
34
36{
37 Oid oid; /* oid */
38
39 Oid stxrelid BKI_LOOKUP(pg_class); /* relation containing
40 * attributes */
41
42 /* These two fields form the unique key for the entry: */
43 NameData stxname; /* statistics object name */
44 Oid stxnamespace BKI_LOOKUP(pg_namespace); /* OID of statistics
45 * object's namespace */
46
47 Oid stxowner BKI_LOOKUP(pg_authid); /* statistics object's owner */
48
49 /*
50 * variable-length/nullable fields start here, but we allow direct access
51 * to stxkeys
52 */
53 int2vector stxkeys BKI_FORCE_NOT_NULL; /* array of column keys */
54
55#ifdef CATALOG_VARLEN
56 int16 stxstattarget BKI_DEFAULT(_null_) BKI_FORCE_NULL; /* statistics target */
57 char stxkind[1] BKI_FORCE_NOT_NULL; /* statistics kinds requested
58 * to build */
59 pg_node_tree stxexprs; /* A list of expression trees for stats
60 * attributes that are not simple column
61 * references. */
62#endif
63
65
67
68/* ----------------
69 * Form_pg_statistic_ext corresponds to a pointer to a tuple with
70 * the format of pg_statistic_ext relation.
71 * ----------------
72 */
74
76
80
83
85
86#ifdef EXPOSE_TO_CLIENT_CODE
87
88#define STATS_EXT_NDISTINCT 'd'
89#define STATS_EXT_DEPENDENCIES 'f'
90#define STATS_EXT_MCV 'm'
91#define STATS_EXT_EXPRESSIONS 'e'
92
93#endif /* EXPOSE_TO_CLIENT_CODE */
94
95#endif /* PG_STATISTIC_EXT_H */
int16_t int16
Definition c.h:553
#define BEGIN_CATALOG_STRUCT
Definition genbki.h:37
#define DECLARE_UNIQUE_INDEX_PKEY(name, oid, oidmacro, tblname, decl)
Definition genbki.h:105
#define BKI_LOOKUP(catalog)
Definition genbki.h:65
#define DECLARE_ARRAY_FOREIGN_KEY(cols, reftbl, refcols)
Definition genbki.h:139
#define END_CATALOG_STRUCT
Definition genbki.h:38
#define BKI_DEFAULT(value)
Definition genbki.h:54
#define DECLARE_UNIQUE_INDEX(name, oid, oidmacro, tblname, decl)
Definition genbki.h:104
#define BKI_FORCE_NOT_NULL
Definition genbki.h:52
#define DECLARE_TOAST(name, toastoid, indexoid)
Definition genbki.h:82
#define BKI_FORCE_NULL
Definition genbki.h:51
#define CATALOG(name, oid, oidmacro)
Definition genbki.h:42
#define DECLARE_INDEX(name, oid, oidmacro, tblname, decl)
Definition genbki.h:103
#define MAKE_SYSCACHE(name, idxname, nbuckets)
Definition genbki.h:146
int16 attnum
END_CATALOG_STRUCT typedef FormData_pg_statistic_ext * Form_pg_statistic_ext
FormData_pg_statistic_ext
unsigned int Oid
static int fb(int x)
Definition c.h:772