Re: Avoid Wraparound Failures - Mailing list pgsql-admin

From Ron
Subject Re: Avoid Wraparound Failures
Date
Msg-id 5b742974-2d28-f6a9-9340-96341389a1b6@gmail.com
Whole thread Raw
In response to Avoid Wraparound Failures  (Loles <lolesft@gmail.com>)
List pgsql-admin
On 3/25/22 17:16, Loles wrote:
Hi!

Suppose the databases on my instance are near to have a wraparound failure.

Is this actually the case, or are you just afraid?


(I think so, from what I see, but in the PostgreSQL log I haven't seen any warning about It yet).

What do I have to do?

vacuum freeze;

Kinda, but really... Heck No!!!

vacuum --freeze --jobs=`nproc` --dbname=your_db_name

That will VACUUM FREEZE every table in your database in multiple threads.

However, you only need to freeze tables getting near wraparound.  pg_class.relfrozenxid tells you which tables to worry about.


better than,

vacuum analyze;

VACUUM ANALYZE does a plain vacuum plus collects statistics for the query analyzer.  Collecting query stats has nothing to do with vacuuming or protecting against wraparound.


Or both?

If the autovacuum_freeze configuration parameters have defaults values, should I modify any first?


What version are you running?  Even the recently EOL versions protect from wraparound (though it's a painful last-ditch process).

--
Angular momentum makes the world go 'round.

pgsql-admin by date:

Previous
From: Loles
Date:
Subject: Avoid Wraparound Failures
Next
From: Laurenz Albe
Date:
Subject: Re: Avoid Wraparound Failures