[pgsql-jp: 29847] ファイルの肥大化

yoichi_takano @ ha.daifuku.co.jp yoichi_takano @ ha.daifuku.co.jp
2003年 5月 12日 (月) 13:59:06 JST



お世話になります。高野と申します。

Redhat8.0 PostgreSQL7.1.3で運用しております。

pgdata以下に大きなファイルができて、消えずに困っております。

bash-2.05$ ls -l /usr/local/pgsql/data/base/26228/16948*
-rw-------   1 postgres other    1073741824  8月  5  2002 16948
-rw-------   1 postgres other    1073741824  9月  9  2002 16948.1
-rw-------   1 postgres other    1073741824  9月 30  2002 16948.2
-rw-------   1 postgres other    1073741824 11月  5  2002 16948.3
-rw-------   1 postgres other    1073741824 11月 20 10:10 16948.4
-rw-------   1 postgres other    1073741824  1月 18 15:46 16948.5
-rw-------   1 postgres other    1073741824  3月 11 11:23 16948.6
-rw-------   1 postgres other    1073741824  3月 28 10:27 16948.7
-rw-------   1 postgres other    553181184  5月 12 13:24 16948.8
bash-2.05$

そこで以下のようにしてみるとラージオブジェクトで管理しているファイル
が大きくなっていのものと予想しましたが、実際ラージオブジェクトで管
理しているデータの合計は77965334 (byte)しかありません。

=# select * from pg_class where relfilenode='16948';
    relname     | reltype | relowner | relam | relfilenode | relpages | reltuple
s | reltoastrelid | reltoastidxid | relhasindex | relisshared | relkind | relnat
ts | relchecks | reltriggers | relukeys | relfkeys | relrefs | relhaspkey | relh
asrules | relhassubclass | relacl
----------------+---------+----------+-------+-------------+-
--+---------------+---------------+-------------+------------
---+-----------+-------------+----------+----------+---------
--------+----------------+--------
 pg_largeobject |   16949 |     1002 |     0 |       16948 |  1105669 |   335012
8 |             0 |             0 | t           | f           | r       |
 3 |         0 |           0 |        0 |        0 |       0 | f          | f
        | f              |
(1 row)


hoge=# \d pg_largeobject
     Table "pg_largeobject"
 Attribute |  Type   | Modifier
-----------+---------+----------
 loid       | oid     |
 pageno    | integer |
 data       | bytea   |
Index: pg_largeobject_loid_pn_index

hoge=#

hoge=# select sum(file_size) from file_lobj;
   sum
----------
 77965334
(1 row)


念のため、MLにて井上様が以前ご指摘されて方法も行いましたが効果
はありませんでした。

http://www.sra.co.jp/people/t-ishii/PostgreSQL/old/mhonarc/pgsql-jp/2002Apr/msg00220.html
> 井上です。
> システムテーブルやインデクスを消去するとPostgresが
> 動かなくなってしまいます。pg_attributeのインデクス
> が膨れ上がっているようなのでインデクスを再編成して
> 圧縮する必要があります。
> 以下の手順でやってみてください。
> 1) postmasterを停止する。
> 2) standaloneのpostgresを起動する。
>  postgres -P -O データベース名
> 3) pg_attributeのインデクスを再編成する
>  reindex table pg_attribute force;
> 4) standaloneのpostgresを終了する(Ctrl-d)
> 5) postmasterを再起動する。

どなかたこの件についてご存知の方おられないでしょうか?

お手数ですが宜しくお願いします。







pgsql-jp メーリングリストの案内