Re: VACUUM freeze - Mailing list pgsql-admin

From Laurenz Albe
Subject Re: VACUUM freeze
Date
Msg-id 8042edc6f769a8577ee36b1167e355f254141d97.camel@cybertec.at
Whole thread Raw
In response to VACUUM freeze  (Arnav <justdba03@gmail.com>)
List pgsql-admin
On Sat, 2020-04-18 at 23:55 +0530, Arnav wrote:
> what is VACUUM freeze , does it not allow autovacuum to happen ever.
> if yes till how long?

VACUUM (FREEZE) marks all rows that are visible to everybody as
unconditionally visible.
All rows that live long have to get frozen at some point, so that they
can survive transaction wraparound without data corruption, because the
internal transaction ID that created them is stored in the row metadata.

This can be useful for insert-only tables, since autovacuum won't have
to touch frozen rows ever again unless they get updated or deleted.

The negative aspect of freezing all rows is that all rows that are frozen
get modified, which means that the block containing them becomes dirty
and has to be written to disk again.  Now if any such row is modified or
deleted later, freezing the row has generated unnecessary I/O.

This is why by default VACUUM will freeze only rows whose creating
transaction is more then 50 million transactions in the past, in the
hope that such rows have less chance to be modified again than more
recent rows.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-admin by date:

Previous
From: Keith
Date:
Subject: Re: VACUUM freeze
Next
From: Laurenz Albe
Date:
Subject: Re: checkpoint process use too much memory