Re: Per-Table vacuum_freeze_min_age - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Per-Table vacuum_freeze_min_age
Date
Msg-id acc47b70-db3b-f57e-8893-51689b3ffec3@aklaver.com
Whole thread Raw
In response to Per-Table vacuum_freeze_min_age  (Chris Bisnett <cbisnett@gmail.com>)
Responses Re: Per-Table vacuum_freeze_min_age  (Chris Bisnett <cbisnett@gmail.com>)
List pgsql-general
On 4/6/22 3:13 PM, Chris Bisnett wrote:
> Hi all!
> 
> I have several large tables (1-2Tb) that are 99.9% writes (small number 
> of updates) with a decent commit rate (20K/sec). The basic idea is that 
> it’s generating a lot of data continuously. When the table would reach 
> the thresholds for autovacuum a vacuum would start and would start 
> generating wal write lock wait events. Once I set the freeze age to 
> 500,000 (default is 50,000,000) the vacuums have to touch many fewer 
> pages and is significantly faster without causing any write lock wait 
> events.
> 
> The only downside I’ve seen is that this is a global setting and my 
> understanding is that this would cause decreased performance when used 
> with tables with a lot of writes and deletes. Is there a technical 
> reason this setting cannot be applied at the database or table context 
> like other autovacuum settings?

It can:

https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-STORAGE-PARAMETERS

Per-table value for vacuum_freeze_min_age parameter.
> 
> - chris
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Per-Table vacuum_freeze_min_age
Next
From: Perry Smith
Date:
Subject: What have I done!?!?!? :-)