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

53.53. pg_statistic_ext_data #

The catalog <structname>pg_statistic_ext_data</structname> holds data for extended planner statistics defined in <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>. Each row in this catalog corresponds to a <firstterm>statistics object</firstterm> created with <link linkend="sql-createstatistics"><command>CREATE STATISTICS</command></link>. カタログpg_statistic_ext_dataは、pg_statistic_extで定義されたプランナの拡張統計情報のデータを保持します。 このカタログの個々の行はCREATE STATISTICSで作成された統計情報オブジェクトに関連します。

Normally there is one entry, with <structfield>stxdinherit</structfield> = <literal>false</literal>, for each statistics object that has been analyzed. If the table has inheritance children or partitions, a second entry with <structfield>stxdinherit</structfield> = <literal>true</literal> is also created. This row represents the statistics object over the inheritance tree, i.e., statistics for the data you'd see with <literal>SELECT * FROM <replaceable>table</replaceable>*</literal>, whereas the <structfield>stxdinherit</structfield> = <literal>false</literal> row represents the results of <literal>SELECT * FROM ONLY <replaceable>table</replaceable></literal>. 通常は、解析される統計情報オブジェクト毎に、stxdinherit = falseを持つ1つの項目が存在します。 テーブルが継承された子あるいはパーティションを持つ場合、stxdinherit = trueを持つ2つ目の項目が作成されます。 この行は継承ツリー全体に渡る列の統計情報、つまり、SELECT * FROM table*で確認できるデータに対する統計情報を表します。 一方でstxdinherit = falseの行はSELECT * FROM ONLY tableの結果を表します。

Like <link linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link>, <structname>pg_statistic_ext_data</structname> should not be readable by the public, since the contents might be considered sensitive. (Example: most common combinations of values in columns might be quite interesting.) <link linkend="view-pg-stats-ext"><structname>pg_stats_ext</structname></link> is a publicly readable view on <structname>pg_statistic_ext_data</structname> (after joining with <link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>) that only exposes information about those tables and columns that are readable by the current user. pg_statistic同様、pg_statistic_ext_dataはテーブル内容が秘密の情報とみなされますので、一般のユーザが読み取り可能であってはいけません。 (列の値の最も共通した組み合わせは誰もが興味をそそられる良い例ですよね。) pg_stats_extは一般のユーザが読み取り可能な(pg_statistic_extと結合後の)pg_statistic_ext_dataに対するビューで、現在のユーザが読んでも差し支えないテーブルと列の情報のみを開示しています。

表53.53 pg_statistic_ext_dataの列

<title><structname>pg_statistic_ext_data</structname> Columns</title>

Column Type 列 型

Description 説明

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

Extended statistics object containing the definition for this data このデータの定義を含む拡張統計情報オブジェクト

stxdinherit bool

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

stxdndistinct pg_ndistinct

N-distinct counts, serialized as <structname>pg_ndistinct</structname> type pg_ndistinct型にシリアライズされたN個別値の数

stxddependencies pg_dependencies

Functional dependency statistics, serialized as <structname>pg_dependencies</structname> type pg_dependencies型にシリアライズされた関数従属統計

stxdmcv pg_mcv_list

MCV (most-common values) list statistics, serialized as <structname>pg_mcv_list</structname> type pg_mcv_list型にシリアライズされたMCV(最も共通の値)リスト統計情報

stxdexpr pg_statistic[]

Per-expression statistics, serialized as an array of <structname>pg_statistic</structname> type pg_statistic型の配列にシリアライズされた演算式ごとの統計情報