leas
leas

Reputation: 301

When to vacuum freeze a partition of a postgres table?

I have a postgresql-12 database containing tables that are partitioned on timestamp column. So, rows with timestamp belonging in day N are inserted in a child table that is attached to the parent table.

After the data are inserted there are no updates nor deletes performed on the partition, and the whole partition is dropped when the expiration period comes.

I am thinking to perform a Vacuum freeze on the old partitions, since they are Read-only, in order to make vacuum operation faster and more efficient.

Is this going to make vacuum on the parent table faster? My understanding is that when vacuuming the parent table, all frozen partitions will be skipped thus making the (vacuum) operation faster, is this correct?

Which are the advantages of vacuum freeze and when it should be used? Is it for situations like the one described above?

Are there any side-effects if I try to reinsert (delete + insert) data in a frozen partition?

Upvotes: 0

Views: 83

Answers (0)

Related Questions