Updated on 2024-06-03 GMT+08:00

PG_EXT_STATS

PG_EXT_STATS displays extended statistics stored in PG_STATISTIC_EXT. The extension statistics means multiple columns of statistics. For details about the columns, see Table 1.

Table 1 PG_EXT_STATS columns

Name

Type

Reference

Description

schemaname

name

PG_NAMESPACE.nspname

Name of the schema that contains a table.

tablename

name

relname in PG_CLASS

Table name

attname

int2vector

PG_STATISTIC_EXT.stakey

Columns to be combined for collecting statistics

inherited

boolean

-

Inherited tables are not supported currently. The value of this column is false.

null_frac

real

-

Percentage of column combinations that are null to all records

avg_width

integer

-

Average width of column combinations, in byte

n_distinct

real

-

  • Estimated number of distinct values in a column combination if the value is greater than 0
  • Negative number obtained by multiplying the result calculated by dividing the number of distinct values by the number of rows by –1 if the value is less than 0. For example, –1 indicates that the number of distinct values is the same as the number of rows for a column combination.
    1. The negated form is used when ANALYZE believes that the number of distinct values is likely to increase as the table grows.
    2. The positive form is used when the column seems to have a fixed number of possible values.
  • The number of distinct values is unknown if the value is 0.

n_dndistinct

real

-

Number of not-null distinct values in the dn1 column combination.
  • Exact number of distinct values if the value is greater than 0.
  • Negative number obtained by multiplying the result calculated by dividing the number of distinct values by the number of rows by –1 if the value is less than 0. For example, if a value in a column combination appears twice in average, n_dndistinct equals –0.5.
  • The number of distinct values is unknown if the value is 0.

most_common_vals

anyarray

-

List of the most common values in a column combination. If this combination does not have the most common values, this column will be NULL. None of the most common values in the column is NULL.

most_common_freqs

real[]

-

List of the frequencies of the most common values in a column combination. The frequencies are obtained by dividing the number of occurrences of each value by the number of rows. If the value of most_common_vals is NULL, the value of this column is NULL.

most_common_vals_null

anyarray

-

List of the most common values in a column combination. If this combination does not have the most common values, this column will be NULL. At least one of the common values in the column is NULL.

most_common_freqs_null

real[]

-

List of the frequencies of the most common values in a column combination. The frequencies are obtained by dividing the number of occurrences of each value by the number of rows. If the value of most_common_vals_null is NULL, the value of this column is NULL.

histogram_bounds

anyarray

-

Boundary value list of the histogram

partitionname

name

PG_PARTITION.relname

Name of the level-1 partition in the partitioned table. For a non-partitioned table, this field is left blank.

subpartitionname

name

PG_PARTITION.relname

Name of the level-2 partition in the partitioned table. For a distributed system, this field is left blank.