1 /*-------------------------------------------------------------------------
4 * definition of the system "extended statistic" relation (pg_statistic_ext)
5 * along with the relation's initial contents.
8 * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
9 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/include/catalog/pg_statistic_ext.h
14 * the genbki.pl script reads this file and generates .bki
15 * information from the DATA() statements.
17 *-------------------------------------------------------------------------
19 #ifndef PG_STATISTIC_EXT_H
20 #define PG_STATISTIC_EXT_H
22 #include "catalog/genbki.h"
25 * pg_statistic_ext definition. cpp turns this into
26 * typedef struct FormData_pg_statistic_ext
29 #define StatisticExtRelationId 3381
31 CATALOG(pg_statistic_ext,3381)
33 Oid stxrelid; /* relation containing attributes */
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 */
39 Oid stxowner; /* statistics object's owner */
42 * variable-length fields start here, but we allow direct access to
45 int2vector stxkeys; /* array of column keys */
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) */
54 } FormData_pg_statistic_ext;
57 * Form_pg_statistic_ext corresponds to a pointer to a tuple with
58 * the format of pg_statistic_ext relation.
61 typedef FormData_pg_statistic_ext *Form_pg_statistic_ext;
64 * compiler constants for pg_statistic_ext
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
77 #define STATS_EXT_NDISTINCT 'd'
78 #define STATS_EXT_DEPENDENCIES 'f'
80 #endif /* PG_STATISTIC_EXT_H */