2 53.31. pg_stats_ext_exprs #
4 The view pg_stats_ext_exprs provides access to information about all
5 expressions included in extended statistics objects, combining
6 information stored in the pg_statistic_ext and pg_statistic_ext_data
7 catalogs. This view allows access only to rows of pg_statistic_ext and
8 pg_statistic_ext_data that correspond to tables the user owns, and
9 therefore it is safe to allow public read access to this view.
11 pg_stats_ext_exprs is also designed to present the information in a
12 more readable format than the underlying catalogs — at the cost that
13 its schema must be extended whenever the structure of statistics in
14 pg_statistic_ext changes.
16 Table 53.31. pg_stats_ext_exprs Columns
22 schemaname name (references pg_namespace.nspname)
24 Name of schema containing table
26 tablename name (references pg_class.relname)
28 Name of table the statistics object is defined on
30 statistics_schemaname name (references pg_namespace.nspname)
32 Name of schema containing extended statistics object
34 statistics_name name (references pg_statistic_ext.stxname)
36 Name of extended statistics object
38 statistics_owner name (references pg_authid.rolname)
40 Owner of the extended statistics object
44 Expression included in the extended statistics object
46 inherited bool (references pg_statistic_ext_data.stxdinherit)
48 If true, the stats include values from child tables, not just the
49 values in the specified relation
53 Fraction of expression entries that are null
57 Average width in bytes of expression's entries
61 If greater than zero, the estimated number of distinct values in the
62 expression. If less than zero, the negative of the number of distinct
63 values divided by the number of rows. (The negated form is used when
64 ANALYZE believes that the number of distinct values is likely to
65 increase as the table grows; the positive form is used when the
66 expression seems to have a fixed number of possible values.) For
67 example, -1 indicates a unique expression in which the number of
68 distinct values is the same as the number of rows.
70 most_common_vals anyarray
72 A list of the most common values in the expression. (Null if no values
73 seem to be more common than any others.)
75 most_common_freqs float4[]
77 A list of the frequencies of the most common values, i.e., number of
78 occurrences of each divided by total number of rows. (Null when
81 histogram_bounds anyarray
83 A list of values that divide the expression's values into groups of
84 approximately equal population. The values in most_common_vals, if
85 present, are omitted from this histogram calculation. (This expression
86 is null if the expression data type does not have a < operator or if
87 the most_common_vals list accounts for the entire population.)
91 Statistical correlation between physical row ordering and logical
92 ordering of the expression values. This ranges from -1 to +1. When the
93 value is near -1 or +1, an index scan on the expression will be
94 estimated to be cheaper than when it is near zero, due to reduction of
95 random access to the disk. (This expression is null if the expression's
96 data type does not have a < operator.)
98 most_common_elems anyarray
100 A list of non-null element values most often appearing within values of
101 the expression. (Null for scalar types.)
103 most_common_elem_freqs float4[]
105 A list of the frequencies of the most common element values, i.e., the
106 fraction of rows containing at least one instance of the given value.
107 Two or three additional values follow the per-element frequencies;
108 these are the minimum and maximum of the preceding per-element
109 frequencies, and optionally the frequency of null elements. (Null when
110 most_common_elems is.)
112 elem_count_histogram float4[]
114 A histogram of the counts of distinct non-null element values within
115 the values of the expression, followed by the average number of
116 distinct non-null elements. (Null for scalar types.)
118 The maximum number of entries in the array fields can be controlled on
119 a column-by-column basis using the ALTER TABLE SET STATISTICS command,
120 or globally by setting the default_statistics_target run-time