aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/pgstattuple/README.pgstattuple.euc_jp130
1 files changed, 103 insertions, 27 deletions
diff --git a/contrib/pgstattuple/README.pgstattuple.euc_jp b/contrib/pgstattuple/README.pgstattuple.euc_jp
index c4c8fa15104..6314365d7fc 100644
--- a/contrib/pgstattuple/README.pgstattuple.euc_jp
+++ b/contrib/pgstattuple/README.pgstattuple.euc_jp
@@ -1,39 +1,115 @@
-$PostgreSQL: pgsql/contrib/pgstattuple/README.pgstattuple.euc_jp,v 1.7 2006/07/06 02:18:07 momjian Exp $
+$PostgreSQL: pgsql/contrib/pgstattuple/README.pgstattuple.euc_jp,v 1.8 2006/09/04 03:49:05 momjian Exp $
pgstattuple README 2002/08/22 石井達夫
-1. pgstattupleとは
+1. サポートされている関数
+ pgstattuple
+ -----------
pgstattupleは,UPDATEやDELETEで作られたリレーションのゴミ領域の大きさを,
リレーション自体の物理的な大きさに対するパーセンテージで返却します.つ
まり,返却値が大きければ,それだけゴミも多いので,vacuumをかける必
要があるという判断の助けになるわけです.これ以外にもいろいろな情報
が返ります.
-
-test=# \x
-Expanded display is on.
-test=# select * from pgstattuple('pg_proc');
--[ RECORD 1 ]------+-------
-table_len | 458752
-tuple_count | 1470
-tuple_len | 438896
-tuple_percent | 95.67
-dead_tuple_count | 11
-dead_tuple_len | 3157
-dead_tuple_percent | 0.69
-free_space | 8932
-free_percent | 1.95
-
-各項目の説明です.
-
-table_len -- リレーションの物理的な大きさ(バイト)
-tuple_count -- タプル数
-tuple_len -- タプル長の合計(バイト)
-tuple_percent -- タプルの割合.table_lenに対するtuple_lenの比率.
-dead_tuple_len -- デッドタプル数
-dead_tuple_percent -- デッドタプルの割合.table_lenに対するtuple_lenの比率.
-free_space -- 再利用可能な領域(バイト)
-free_percent -- 再利用可能な領域.table_lenに対するfree_spaceの比率.
+ pgstattuple() は、リレーションの長さや、タプルの"ゴミ領域"の割合などの
+ 情報を返却します。これらの情報は、vacuum が必要かどうか、ユーザが判断
+ するのに役立つでしょう。例えば以下のような形になります:
+
+ test=> \x
+ Expanded display is on.
+ test=> SELECT * FROM pgstattuple('pg_catalog.pg_proc');
+ -[ RECORD 1 ]------+-------
+ table_len | 458752
+ tuple_count | 1470
+ tuple_len | 438896
+ tuple_percent | 95.67
+ dead_tuple_count | 11
+ dead_tuple_len | 3157
+ dead_tuple_percent | 0.69
+ free_space | 8932
+ free_percent | 1.95
+
+ 以下が各項目の内容です:
+
+ table_len -- リレーションの物理的な大きさ(バイト)
+ tuple_count -- タプル数
+ tuple_len -- タプル長の合計(バイト)
+ tuple_percent -- タプルの割合.table_lenに対するtuple_lenの比率.
+ dead_tuple_len -- デッドタプル数
+ dead_tuple_percent -- デッドタプルの割合.table_lenに対するtuple_lenの比率.
+ free_space -- 再利用可能な領域(バイト)
+ free_percent -- 再利用可能な領域.table_lenに対するfree_spaceの比率.
+
+ pg_relpages
+ -----------
+ pg_relpages() はリレーションのページ数を返却します.
+
+ pgstatindex
+ -----------
+ pgstatindex() はインデックスに関する情報を返却します:
+
+ test=> \x
+ Expanded display is on.
+ test=> SELECT * FROM pgstatindex('pg_cast_oid_index');
+ -[ RECORD 1 ]------+------
+ version | 2
+ tree_level | 0
+ index_size | 8192
+ root_block_no | 1
+ internal_pages | 0
+ leaf_pages | 1
+ empty_pages | 0
+ deleted_pages | 0
+ avg_leaf_density | 50.27
+ leaf_fragmentation | 0
+
+ bt_metap
+ --------
+ bt_metap() はbtreeインデックスのメタページに関する情報を返却します:
+
+ test=> SELECT * FROM bt_metap('pg_cast_oid_index');
+ -[ RECORD 1 ]-----
+ magic | 340322
+ version | 2
+ root | 1
+ level | 0
+ fastroot | 1
+ fastlevel | 0
+
+ bt_page_stats
+ -------------
+ bt_page_stats() は、btreeの単一のページに関する情報を表示します:
+
+ test=> SELECT * FROM bt_page_stats('pg_cast_oid_index', 1);
+ -[ RECORD 1 ]-+-----
+ blkno | 1
+ type | l
+ live_items | 256
+ dead_items | 0
+ avg_item_size | 12
+ page_size | 8192
+ free_size | 4056
+ btpo_prev | 0
+ btpo_next | 0
+ btpo | 0
+ btpo_flags | 3
+
+ bt_page_items
+ -------------
+ bt_page_items() は、各btreeページの個別のアイテムに関する情報を表示します:
+
+ test=> SELECT * FROM bt_page_items('pg_cast_oid_index', 1);
+ itemoffset | ctid | itemlen | nulls | vars | data
+ ------------+---------+---------+-------+------+-------------
+ 1 | (0,1) | 12 | f | f | 23 27 00 00
+ 2 | (0,2) | 12 | f | f | 24 27 00 00
+ 3 | (0,3) | 12 | f | f | 25 27 00 00
+ 4 | (0,4) | 12 | f | f | 26 27 00 00
+ 5 | (0,5) | 12 | f | f | 27 27 00 00
+ 6 | (0,6) | 12 | f | f | 28 27 00 00
+ 7 | (0,7) | 12 | f | f | 29 27 00 00
+ 8 | (0,8) | 12 | f | f | 2a 27 00 00
+
2. pgstattupleのインストール