Updated on 2025-10-14 GMT+08:00

PV_RUNTIME_EXPRSTATS

PV_RUNTIME_EXPRSTATS displays expression statistics generated by autoanalyze in the memory. This view is supported only by clusters of version 8.2.1.200 or later.

Table 1 PV_RUNTIME_EXPRSTATS columns

Column

Type

Reference

Description

schemaname

name

PG_NAMESPACE.nspname

Name of the schema that contains the table

tablename

name

PG_CLASS.relname

Table name

statistics_schemaname

name

-

Name of the schema where expression objects whose statistics are collected is located

statistics_name

name

-

Name of the expression object whose statistics are collected

statistics_owner

name

-

Owner of the expression object whose statistics are collected

expr

text

-

Expression

inherited

boolean

-

If the value is true, the inherited subcolumns are included. If the value is false, only the columns in a specified table are included.

null_frac

real

-

Percentage of column entries that are null

avg_width

integer

-

Average width in bytes of column's entries

n_distinct

real

-

  • If the value is greater than 0, it indicates the estimated number of distinct values in the column.
  • Negative of the number of distinct values divided by the number of rows if the value is less than 0

The negated form is used when ANALYZE believes that the number of distinct values is likely to increase as the table grows.

The positive form is used when the column seems to have a fixed number of possible values. For example, -1 indicates a unique column in which the number of distinct values is the same as the number of rows.

n_dndistinct

real

-

Number of unique non-null data values in the dn1 column

  • Exact number of distinct values if the value is greater than 0
  • Negative of the number of distinct values divided by the number of rows if the value is less than 0 (For example, if the value of a column appears twice in average, set n_dndistinct=-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. If this combination does not have the most common values, it will be NULL.

most_common_freqs

real[]

-

List of the frequencies of the most common values, that is, the number of occurrences of each value divided by the total number of rows. (NULL if most_common_vals is NULL)

histogram_bounds

anyarray

-

List of values that divide the column's values into groups of equal proportion. The values in most_common_vals, if present, are omitted from this histogram calculation. This column is null if the field data type does not have a < operator or if the most_common_vals list accounts for the entire population.

correlation

real

-

Statistical correlation between physical row ordering and logical ordering of the column values. It ranges from -1 to +1. When the value is near to -1 or +1, an index scan on the column is estimated to be cheaper than when it is near to zero, due to reduction of random access to the disk. This column is null if the column data type does not have a < operator.

most_common_elems

anyarray

-

A list of the most commonly used non-null element values

most_common_elem_freqs

real[]

-

A list of the frequencies of the most commonly used element values

elem_count_histogram

real[]

-

A histogram of the counts of distinct non-null element values

level

text

-

Current phase of the memory statistics generated by the lightweight autoanalyze. It can be local, sendlist, or global.