Re: is it safe to drop 25 tb schema with cascade option? - Mailing list pgsql-general

From Tom Lane
Subject Re: is it safe to drop 25 tb schema with cascade option?
Date
Msg-id 15554.1568929375@sss.pgh.pa.us
Whole thread Raw
In response to Re: is it safe to drop 25 tb schema with cascade option?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: is it safe to drop 25 tb schema with cascade option?  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 9/19/19 2:24 PM, Julie Nishimura wrote:
>> Or you meant we need to run vacuum on 'my_db_name' without parameters,  
>> that it runs for every table? I am just not sure how long it will take 
>> to run for 39 tb...:(

> Not sure. The bottom line is you are running out of transaction ids and 
> if the txid counter wraps things get ugly. You could try vacuuming 
> individual non-system tables that have a lot of churn(UPDATES/DELETES) 
> and see if that buys you some ids.

You're going to have to vacuum *all* of them to get the global freeze
counter to advance, as it's basically just the min of the per-table
pg_class.relfrozenxid values.  It might be worth looking at
age(relfrozenxid) to see which tables are furthest back, as those
are the one(s) holding things up; but if you've not been running
autovacuum then it's likely that they are all old.

Do NOT NOT NOT use VACUUM FULL here.  It will not make things any
better than a plain VACUUM, and it will take a lot longer ... time
you maybe haven't got.

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: is it safe to drop 25 tb schema with cascade option?
Next
From: Adrian Klaver
Date:
Subject: Re: is it safe to drop 25 tb schema with cascade option?