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

9.30. 統計情報関数 #

<title>Statistics Information Functions</title>

<productname>PostgreSQL</productname> provides a function to inspect complex statistics defined using the <command>CREATE STATISTICS</command> command. PostgreSQLCREATE STATISTICSコマンドを使って定義した複雑な統計を調べる関数を提供しています。

9.30.1. MCVリストの検査 #

<title>Inspecting MCV Lists</title>
pg_mcv_list_items ( pg_mcv_list ) → setof record

<function>pg_mcv_list_items</function> returns a set of records describing all items stored in a multi-column <acronym>MCV</acronym> list. It returns the following columns: pg_mcv_list_itemsは複数列MCVリストに格納されたすべての項目を列挙します。 この関数は次の列を返します。

名前説明
indexintegerMCVリスト内の項目のインデックス
valuestext[]MCV項目に格納された値
nullsboolean[]NULL値を識別するフラグ
frequencydouble precisionこのMCV項目の頻度
base_frequencydouble precisionこのMCV項目のベース頻度

The <function>pg_mcv_list_items</function> function can be used like this: pg_mcv_list_items関数は次のように使用することができます。

SELECT m.* FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid),
                pg_mcv_list_items(stxdmcv) m WHERE stxname = 'stts';

Values of the <type>pg_mcv_list</type> type can be obtained only from the <structname>pg_statistic_ext_data</structname>.<structfield>stxdmcv</structfield> column. pg_mcv_list型の値はpg_statistic_ext_data.stxdmcv列からのみ得られます。