]> begriffs open source - ai-pg/blob - full-docs/txt/view-pg-stats-ext-exprs.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / view-pg-stats-ext-exprs.txt
1
2 53.31. pg_stats_ext_exprs #
3
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.
10
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.
15
16    Table 53.31. pg_stats_ext_exprs Columns
17
18    Column Type
19
20    Description
21
22    schemaname name (references pg_namespace.nspname)
23
24    Name of schema containing table
25
26    tablename name (references pg_class.relname)
27
28    Name of table the statistics object is defined on
29
30    statistics_schemaname name (references pg_namespace.nspname)
31
32    Name of schema containing extended statistics object
33
34    statistics_name name (references pg_statistic_ext.stxname)
35
36    Name of extended statistics object
37
38    statistics_owner name (references pg_authid.rolname)
39
40    Owner of the extended statistics object
41
42    expr text
43
44    Expression included in the extended statistics object
45
46    inherited bool (references pg_statistic_ext_data.stxdinherit)
47
48    If true, the stats include values from child tables, not just the
49    values in the specified relation
50
51    null_frac float4
52
53    Fraction of expression entries that are null
54
55    avg_width int4
56
57    Average width in bytes of expression's entries
58
59    n_distinct float4
60
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.
69
70    most_common_vals anyarray
71
72    A list of the most common values in the expression. (Null if no values
73    seem to be more common than any others.)
74
75    most_common_freqs float4[]
76
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
79    most_common_vals is.)
80
81    histogram_bounds anyarray
82
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.)
88
89    correlation float4
90
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.)
97
98    most_common_elems anyarray
99
100    A list of non-null element values most often appearing within values of
101    the expression. (Null for scalar types.)
102
103    most_common_elem_freqs float4[]
104
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.)
111
112    elem_count_histogram float4[]
113
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.)
117
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
121    parameter.