]> begriffs open source - ai-pg/blob - full-docs/txt/view-pg-stats-ext.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / view-pg-stats-ext.txt
1
2 53.30. pg_stats_ext #
3
4    The view pg_stats_ext provides access to information about each
5    extended statistics object in the database, combining information
6    stored in the pg_statistic_ext and pg_statistic_ext_data catalogs. This
7    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 is also designed to present the information in a more
12    readable format than the underlying catalogs — at the cost that its
13    schema must be extended whenever new types of extended statistics are
14    added to pg_statistic_ext.
15
16    Table 53.30. pg_stats_ext 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
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    attnames name[] (references pg_attribute.attname)
43
44    Names of the columns included in the extended statistics object
45
46    exprs text[]
47
48    Expressions included in the extended statistics object
49
50    kinds char[]
51
52    Types of extended statistics object enabled for this record
53
54    inherited bool (references pg_statistic_ext_data.stxdinherit)
55
56    If true, the stats include values from child tables, not just the
57    values in the specified relation
58
59    n_distinct pg_ndistinct
60
61    N-distinct counts for combinations of column values. If greater than
62    zero, the estimated number of distinct values in the combination. If
63    less than zero, the negative of the number of distinct values divided
64    by the number of rows. (The negated form is used when ANALYZE believes
65    that the number of distinct values is likely to increase as the table
66    grows; the positive form is used when the column seems to have a fixed
67    number of possible values.) For example, -1 indicates a unique
68    combination of columns in which the number of distinct combinations is
69    the same as the number of rows.
70
71    dependencies pg_dependencies
72
73    Functional dependency statistics
74
75    most_common_vals text[]
76
77    A list of the most common combinations of values in the columns. (Null
78    if no combinations seem to be more common than any others.)
79
80    most_common_val_nulls bool[]
81
82    A list of NULL flags for the most common combinations of values. (Null
83    when most_common_vals is.)
84
85    most_common_freqs float8[]
86
87    A list of the frequencies of the most common combinations, i.e., number
88    of occurrences of each divided by total number of rows. (Null when
89    most_common_vals is.)
90
91    most_common_base_freqs float8[]
92
93    A list of the base frequencies of the most common combinations, i.e.,
94    product of per-value frequencies. (Null when most_common_vals is.)
95
96    The maximum number of entries in the array fields can be controlled on
97    a column-by-column basis using the ALTER TABLE SET STATISTICS command,
98    or globally by setting the default_statistics_target run-time
99    parameter.