PostgreSQL Source Code  git master
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-2019, 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"
27 
28 /* ----------------
29  * pg_statistic_ext definition. cpp turns this into
30  * typedef struct FormData_pg_statistic_ext
31  * ----------------
32  */
33 CATALOG(pg_statistic_ext,3381,StatisticExtRelationId)
34 {
35  Oid oid; /* oid */
36 
37  Oid stxrelid; /* relation containing attributes */
38 
39  /* These two fields form the unique key for the entry: */
40  NameData stxname; /* statistics object name */
41  Oid stxnamespace; /* OID of statistics object's namespace */
42 
43  Oid stxowner; /* statistics object's owner */
44  int32 stxstattarget BKI_DEFAULT(-1); /* statistics target */
45 
46  /*
47  * variable-length fields start here, but we allow direct access to
48  * stxkeys
49  */
50  int2vector stxkeys; /* array of column keys */
51 
52 #ifdef CATALOG_VARLEN
53  char stxkind[1] BKI_FORCE_NOT_NULL; /* statistics kinds requested
54  * to build */
55 #endif
56 
58 
59 /* ----------------
60  * Form_pg_statistic_ext corresponds to a pointer to a tuple with
61  * the format of pg_statistic_ext relation.
62  * ----------------
63  */
65 
66 #ifdef EXPOSE_TO_CLIENT_CODE
67 
68 #define STATS_EXT_NDISTINCT 'd'
69 #define STATS_EXT_DEPENDENCIES 'f'
70 #define STATS_EXT_MCV 'm'
71 
72 #endif /* EXPOSE_TO_CLIENT_CODE */
73 
74 #endif /* PG_STATISTIC_EXT_H */
CATALOG(pg_statistic_ext, 3381, StatisticExtRelationId)
unsigned int Oid
Definition: postgres_ext.h:31
#define BKI_DEFAULT(value)
Definition: genbki.h:35
signed int int32
Definition: c.h:346
#define BKI_FORCE_NOT_NULL
Definition: genbki.h:33
Definition: c.h:603
FormData_pg_statistic_ext
Definition: c.h:577
FormData_pg_statistic_ext * Form_pg_statistic_ext