开发者

Changing fillfactor of existing table

Is it possible to change fillfactor of an开发者_开发百科 existing table in PostgreSQL 8.4?

Or do I have to create copy of a table with new fillfactor - which is not the best approach because of foreign key problems?


Yes, that's possible. But you have to VACUUM FULL or CLUSTER this table afterwards to rewrite the table.

ALTER TABLE foo SET ( fillfactor = 50);
VACUUM FULL foo;


ALTER TABLE foo SET ( fillfactor = 20);
VACUUM FULL foo;

View table options incl. fill factors

select t.relname as table_name, 
       t.reloptions
from pg_class t
  join pg_namespace n on n.oid = t.relnamespace
where n.nspname = 'jxy'
  and t.relname in ('xx', '')
;

Then

run pg_repack
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜