« SSH を パスワード なし で 接続したい | HOME | EXT3 チューニング »
Postgres テーブルスペース
テーブルスペースの一覧
\db+
List of tablespaces
Name | Owner | Location | Access privileges
------------+----------+----------+-------------------
pg_default | postgres | |
pg_global | postgres | |
(2 rows)
テーブルスペースとは、その名の通りテーブルの場所です。
たとえば
CREATE TABLESPACE disk2 LOCATION '/disk2/pgdata';
のようなコマンドをたたくと
\db+
List of tablespaces
Name | Owner | Location | Access privileges
------------+----------+----------+-------------------
disk2 | postgres | |
pg_default | postgres | |
pg_global | postgres | |
(3 rows)
すでにあるテーブルを移動させたい時は
ALTER TABLE srctabl1 SET TABLESPACE disk1;
この基本的な使い方は、高負荷時のDiskI/Oの分散です。
負荷分散なので、同一Diskの別フォルダに作成しても意味ないので気をつけましょう。