バージョンごとのドキュメント一覧

54.29. pg_stats_ext_exprs #

The view <structname>pg_stats_ext_exprs</structname> provides access to information about all expressions included in extended statistics objects, combining information stored in the <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link> and <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link> catalogs. This view allows access only to rows of <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link> and <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link> that correspond to tables the user has permission to read, and therefore it is safe to allow public read access to this view. pg_stats_ext_exprsビューは、pg_statistic_extpg_statistic_ext_dataカタログと組み合わせて拡張統計オブジェクトに含まれるすべての式に関する情報へのアクセスを提供します。 このビューは、ユーザが読み込み権限を持つテーブルに一致するpg_statistic_extpg_statistic_ext_dataの行に対してのみアクセスを許可しています。 よって、このビューに対して一般に読み込みを許可しても安全です。

<structname>pg_stats_ext_exprs</structname> is also designed to present the information in a more readable format than the underlying catalogs &mdash; at the cost that its schema must be extended whenever the structure of statistics in <structname>pg_statistic_ext</structname> changes. またpg_stats_ext_exprsは背後にあるカタログよりも可読性の高い情報を提供するように設計されています。 ただしそのためにpg_statistic_extの統計情報の構造が変更されるたびに、そのスキーマを拡張しなければならないというコストがかかります。

表54.29 pg_stats_ext_exprs Columns

Column Type 列 型

Description 説明

schemaname name (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>) (参照先 pg_namespace.nspname

Name of schema containing table テーブルを含むスキーマ名

tablename name (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>) (参照先 pg_class.relname

Name of table the statistics object is defined on 統計情報オブジェクトが定義されているテーブル名

statistics_schemaname name (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>) (参照先 pg_namespace.nspname

Name of schema containing extended statistics object 拡張統計情報オブジェクトを含むスキーマ名

statistics_name name (references <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>.<structfield>stxname</structfield>) (参照先 pg_statistic_ext.stxname

Name of extended statistics object 拡張統計オブジェクトの名前

statistics_owner name (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>) (参照先 pg_authid.rolname

Owner of the extended statistics object 拡張統計オブジェクトの所有者

expr text

Expression included in the extended statistics object 拡張統計オブジェクトに含まれる式

inherited bool (references <link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>.<structfield>stxdinherit</structfield>) (参照先 pg_statistic_ext_data.stxdinherit

If true, the stats include values from child tables, not just the values in the specified relation trueの場合は、統計情報には指定されたリレーションの値だけではなく、子テーブルの値も含まれます。

null_frac float4

Fraction of expression entries that are null NULLである式項目の割合

avg_width int4

Average width in bytes of expression's entries 式項目の幅の平均バイト数

n_distinct float4

If greater than zero, the estimated number of distinct values in the expression. If less than zero, the negative of the number of distinct values divided by the number of rows. (The negated form is used when <command>ANALYZE</command> believes that the number of distinct values is likely to increase as the table grows; the positive form is used when the expression seems to have a fixed number of possible values.) For example, -1 indicates a unique expression in which the number of distinct values is the same as the number of rows. ゼロよりも大きければ、式中の個別の値の数の見積で、ゼロよりも小さければ、個別の値の数を符号反転し行数で割ったものです。 (負の値の形式は、ANALYZEがテーブルが大きくなるにつれ個別の値の数も大きくなると判断した場合に使用されます。 正の値の形式は、可能な値の数が定まった数になると思われる時に使用されます。) たとえば-1は、列のユニークな組み合わせに対し異なる組み合わせの数が行数と同じであることを示しています。

most_common_vals anyarray

A list of the most common values in the expression. (Null if no values seem to be more common than any others.) 列における最も共通した値の組み合わせのリスト。 (他の組み合わせよりも共通した組み合わせが見つからない場合はNULL。)

most_common_freqs float4[]

A list of the frequencies of the most common values, i.e., number of occurrences of each divided by total number of rows. (Null when <structfield>most_common_vals</structfield> is.) 最も共通した値の発生頻度のリスト。つまり、発生数を合計行数で割ったもの。 (most_common_valsがNULLならNULL。)

histogram_bounds anyarray

A list of values that divide the expression's values into groups of approximately equal population. The values in <structfield>most_common_vals</structfield>, if present, are omitted from this histogram calculation. (This expression is null if the expression data type does not have a <literal>&lt;</literal> operator or if the <structfield>most_common_vals</structfield> list accounts for the entire population.) 式の値を大体同じ母集団のグループ分けになるようにする値のリスト。 most_common_valsがあれば、この中の値はこのヒストグラムの計算では無視されます。 (この式は式のデータ型が<演算子を持たないか、most_common_valsリストが全体の人口を取り扱う時にはNULLとなります。)

correlation float4

Statistical correlation between physical row ordering and logical ordering of the expression values. This ranges from -1 to +1. When the value is near -1 or +1, an index scan on the expression will be estimated to be cheaper than when it is near zero, due to reduction of random access to the disk. (This expression is null if the expression's data type does not have a <literal>&lt;</literal> operator.) 物理的な行の順序と式の値の論理的な順序の間の統計的な相関。 範囲は-1から+1です。 値が-1あるいは+1に近ければ、ディスクへの乱アクセス減るので、式に対するインデックス走査はその値がゼロに近いときよりも安価であると見積もられます。 (式のデータ型が<演算子を持たなければ、式はNULLとなります。)

most_common_elems anyarray

A list of non-null element values most often appearing within values of the expression. (Null for scalar types.) 列の値の中で最もよく出現する非NULLの要素値のリストです。(スカラ型の場合はNULLです。)

most_common_elem_freqs float4[]

A list of the frequencies of the most common element values, i.e., the fraction of rows containing at least one instance of the given value. Two or three additional values follow the per-element frequencies; these are the minimum and maximum of the preceding per-element frequencies, and optionally the frequency of null elements. (Null when <structfield>most_common_elems</structfield> is.) 最も一般的な要素値の出現頻度のリストで、与えられた値の少なくとも1つのインスタンスを含む行の断片です。 2つもしくは3つの追加の値が1つの要素ごとの出現頻度に続きます。 最小で最大の要素ごとの出現頻度があります。さらにオプションとしてNULL要素の出現頻度もあります。 (most_common_elemsがNULLの時はNULLです。)

elem_count_histogram float4[]

A histogram of the counts of distinct non-null element values within the values of the expression, followed by the average number of distinct non-null elements. (Null for scalar types.) 列の値でNULLではない要素値の個別数のヒストグラム。これは個別のNULLではない平均値が後に続きます。(スカラ型の場合はNULLです。)


The maximum number of entries in the array fields can be controlled on a column-by-column basis using the <link linkend="sql-altertable"><command>ALTER TABLE SET STATISTICS</command></link> command, or globally by setting the <xref linkend="guc-default-statistics-target"/> run-time parameter. ALTER TABLE SET STATISTICSコマンドを使って配列フィールドの最大のエントリ数を列単位に制御できます。 あるいはdefault_statistics_target実行時パラメータを設定して一括で制御できます。