[pgsql-jp: 25833] Nomura

daikin @ hkr.ne.jp daikin @ hkr.ne.jp
2002年 5月 6日 (月) 00:48:06 JST


こんばんわ、ひらめ(野村 大樹)と申します。

まいパパさん wrote:
>[pgsql-jp: 25827] にも書いたとおり、昨日InterBaseのポーティングを
>された小山海平さんとお話をしていた時に、「PostgreSQLのコンカレント
>バキュームってどういう方法で実現されているのでしょうね?」という話
>になりました。

たぶん、自分にはわからないレベルの会話が背後に飛び交っていそうな気が
するのですが、ドキュメントでしたら、Administrator's guide の chapter
8. Routine Database Maintenanceのあたりではないしょうか。

自分の目についた所をニつひろってみました。

--#1------------------------------------------------------------------------
 Beginning in PostgreSQL 7.2, the standard form of VACUUM can run in parallel 
with normal database operations (selects, inserts, updates, deletes, but not 
changes to table schemas). Routine vacuuming is therefore not nearly as 
intrusive as it was in prior releases, and it's not as critical to try to 
schedule it at low-usage times of day.

PostgreSQL 7.2 から、VACUUMコマンド(通常モード)は他のデータベース操作と同時
並行して使うことができるようになりました。例えばselect, insert, update, 
delete 等の操作です。ただし、テーブルレイアウトの変更とかはだめです。
毎日実行するvacuumは以前のバージョンに比べて、intrusiveではなくなりました。
誰も使っていない時に、vacuumを実行する操作(例えばcronで真夜中に)は、以前程
神経を使わなくても済むようになりました。


--#2------------------------------------------------------------------------
The standard form of VACUUM is best used with the goal of maintaining a fairly 
level steady-state usage of disk space. The standard form finds old tuples and 
makes their space available for re-use within the table, but it does not try 
very hard to shorten the table file and return disk space to the operating 
system. If you need to return disk space to the operating system you can use 
VACUUM FULL

通常モードのvacuumは "fairly level steady-state usage of disk space" をメンテ
ナンスするには最適でしょう。通常モードは古いタプルを探しだし、テーブルがその
タプル達が占めていた領域を再利用できるようにします。しかし、テーブルのサイズを
短くして、オペレーティングシステムに空き領域としてお返しするということはしま
せん。もし、空き領域をお返ししたい時は、vaccumコマンドのFULLモードを使ってく
ださい。

-----------------------------------------------------------------------------

もっとソースコードに近い話をお求めになってらっしゃるような感じが、、、
やはりhackersな方でないとなんとも、、、

"fairly level steady-state usage of disk space" 
これは、例えば、テスト環境で1000万件insert、削除、なんて
のをやっていて、通常モードのvacuumはしらせてても、disk space
を解放しませんよというような、意味ですよね。
なんて訳せばいいのでしょう?どなたか査読願います。

ではでは。



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