Tag Info

New answers tagged


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 ...


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