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

54.28. pg_stats_ext #

The view <structname>pg_stats_ext</structname> provides access to information about each extended statistics object in the database, 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ビューはpg_statistic_extpg_statistic_ext_dataカタログに格納されている情報へのアクセスを提供します。 このビューは、ユーザが読み込み権限を持つテーブルに一致するpg_statistic_extpg_statistic_ext_dataの行に対してのみアクセスを許可しています。 よって、このビューに対して一般に読み込みを許可しても安全です。

<structname>pg_stats_ext</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 new types of extended statistics are added to <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>. pg_stats_extも、その基礎となっているカタログよりも、より読みやすい書式で情報を提供するように設計されています。 しかし、これはpg_statistic_extに対して新しいスロット型が定義されるたびに、スキーマが拡張されなくてはならない、という犠牲を払っています。

表54.28 pg_stats_extの列

<title><structname>pg_stats_ext</structname> Columns</title>

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 テーブルの名前

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 拡張統計情報オブジェクト所有者

attnames name[] (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attname</structfield>) (参照先 pg_attribute.attname

Names of the columns included in the extended statistics object 拡張統計情報オブジェクトが定義された列名

exprs text[]

Expressions included in the extended statistics object 拡張統計情報オブジェクトが含む式

kinds char[]

Types of extended statistics object enabled for this record このレコードに対して有効になった拡張統計情報の型

inherited bool (references pg_statistic_ext_data.stxdinherit)

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

n_distinct pg_ndistinct

N-distinct counts for combinations of column values. If greater than zero, the estimated number of distinct values in the combination. 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 column seems to have a fixed number of possible values.) For example, -1 indicates a unique combination of columns in which the number of distinct combinations is the same as the number of rows. 列値の組み合わせに対するN個別統計カウント。 ゼロよりも大きければ、その組み合わせに対する個別の値の数の見積で、ゼロよりも小さければ、個別の値の数の見積を符号反転し行数で割ったものです。 (負の値の形式は、ANALYZEがテーブルが大きくなるにつれ個別の値の数も大きくなると判断した場合に使用されます。 正の値の形式は、可能な値の数が定まった数になると思われる時に使用されます。) たとえば-1は、列のユニークな組み合わせに対し異なる組み合わせの数が行数と同じであることを示しています。

dependencies pg_dependencies

Functional dependency statistics 関数従属性統計情報

most_common_vals text[]

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

most_common_val_nulls bool[]

A list of NULL flags for the most common combinations of values. (Null when <structfield>most_common_vals</structfield> is.) 最も共通した値の組み合わせに対するNULLフラグのリスト。 (most_common_valsがNULLならNULL。)

most_common_freqs float8[]

A list of the frequencies of the most common combinations, 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。)

most_common_base_freqs float8[]

A list of the base frequencies of the most common combinations, i.e., product of per-value frequencies. (Null when <structfield>most_common_vals</structfield> is.) 最も共通した組み合わせの発生頻度の基底のリスト。つまり値ごとの頻度の積。 (most_common_valsが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実行時パラメータで広域的に設定することもできます。