Tag Info

New answers tagged

2

The comments so far are roughly correct, but to give an authoritative answer from looking at src/backend/tablecmds.c: If you're only performing ALTER TABLE ... SET TABLESPACE ... ;, then ATExecSetTableSpace() will be invoked to handle the SET TABLESPACE, and it uses copy_relation_data() to perform a WAL-logged block-by-block copy of the table. However, if ...


1

The answer appears to be "moving the table to a different tablespace does not compact it like VACUUM FULL or CLUSTER". I tested this by: creating a dummy table filling it with one million dummy rows to the tune of 38MB deleting all of the rows with "DELETE from DUMMY" moving table to a different tablespace with "ALTER TABLE DUMMY SET TABLESPACE ...



Top 50 recent answers are included