]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_statistic_ext.h
f08379699eaf4bb97be4f56022a4de1a9d294595
[postgresql] / src / include / catalog / pg_statistic_ext.h
1 /*-------------------------------------------------------------------------
2  *
3  * pg_statistic_ext.h
4  *        definition of the system "extended statistic" relation (pg_statistic_ext)
5  *        along with the relation's initial contents.
6  *
7  *
8  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * src/include/catalog/pg_statistic_ext.h
12  *
13  * NOTES
14  *        the genbki.pl script reads this file and generates .bki
15  *        information from the DATA() statements.
16  *
17  *-------------------------------------------------------------------------
18  */
19 #ifndef PG_STATISTIC_EXT_H
20 #define PG_STATISTIC_EXT_H
21
22 #include "catalog/genbki.h"
23
24 /* ----------------
25  *              pg_statistic_ext definition.  cpp turns this into
26  *              typedef struct FormData_pg_statistic_ext
27  * ----------------
28  */
29 #define StatisticExtRelationId  3381
30
31 CATALOG(pg_statistic_ext,3381)
32 {
33         Oid                     stxrelid;               /* relation containing attributes */
34
35         /* These two fields form the unique key for the entry: */
36         NameData        stxname;                /* statistics object name */
37         Oid                     stxnamespace;   /* OID of statistics object's namespace */
38
39         Oid                     stxowner;               /* statistics object's owner */
40
41         /*
42          * variable-length fields start here, but we allow direct access to
43          * stxkeys
44          */
45         int2vector      stxkeys;                /* array of column keys */
46
47 #ifdef CATALOG_VARLEN
48         char            stxkind[1] BKI_FORCE_NOT_NULL;          /* statistic types
49                                                                                                          * requested to build */
50         pg_ndistinct stxndistinct;      /* ndistinct coefficients (serialized) */
51         pg_dependencies stxdependencies;        /* dependencies (serialized) */
52 #endif
53
54 } FormData_pg_statistic_ext;
55
56 /* ----------------
57  *              Form_pg_statistic_ext corresponds to a pointer to a tuple with
58  *              the format of pg_statistic_ext relation.
59  * ----------------
60  */
61 typedef FormData_pg_statistic_ext *Form_pg_statistic_ext;
62
63 /* ----------------
64  *              compiler constants for pg_statistic_ext
65  * ----------------
66  */
67 #define Natts_pg_statistic_ext                                  8
68 #define Anum_pg_statistic_ext_stxrelid                  1
69 #define Anum_pg_statistic_ext_stxname                   2
70 #define Anum_pg_statistic_ext_stxnamespace              3
71 #define Anum_pg_statistic_ext_stxowner                  4
72 #define Anum_pg_statistic_ext_stxkeys                   5
73 #define Anum_pg_statistic_ext_stxkind                   6
74 #define Anum_pg_statistic_ext_stxndistinct              7
75 #define Anum_pg_statistic_ext_stxdependencies   8
76
77 #define STATS_EXT_NDISTINCT                     'd'
78 #define STATS_EXT_DEPENDENCIES          'f'
79
80 #endif   /* PG_STATISTIC_EXT_H */