pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Julie Nishimura <juliezain@hotmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: is it safe to drop 25 tb schema with cascade option?
Date: Thu, 19 Sep 2019 17:42:55 -0400
Message-ID: <15554.1568929375@sss.pgh.pa.us> (raw)
In-Reply-To: <d11cac74-fc57-6949-dfc5-cc50d0c0810d@aklaver.com>
References: <BYAPR08MB5014C652EB9FEE28CB407B58AC890@BYAPR08MB5014.namprd08.prod.outlook.com>
	<71b7be3f-6f7f-cce4-ce76-87febd8295b0@aklaver.com>
	<BYAPR08MB5014775B6DA5A7785D052B3FAC890@BYAPR08MB5014.namprd08.prod.outlook.com>
	<b9d21625-6f45-da7e-e3e3-01771c069941@aklaver.com>
	<BYAPR08MB5014807E8AF95524A6A4F439AC890@BYAPR08MB5014.namprd08.prod.outlook.com>
	<d11cac74-fc57-6949-dfc5-cc50d0c0810d@aklaver.com>

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





view thread (9+ messages)  latest in thread

Message-ID: <15554.1568929375@sss.pgh.pa.us>
Permalink:  ../15554.1568929375@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15554.1568929375@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com, juliezain@hotmail.com
  Subject: Re: is it safe to drop 25 tb schema with cascade option?
  In-Reply-To: <15554.1568929375@sss.pgh.pa.us>
  References: <BYAPR08MB5014C652EB9FEE28CB407B58AC890@BYAPR08MB5014.namprd08.prod.outlook.com> <71b7be3f-6f7f-cce4-ce76-87febd8295b0@aklaver.com> <BYAPR08MB5014775B6DA5A7785D052B3FAC890@BYAPR08MB5014.namprd08.prod.outlook.com> <b9d21625-6f45-da7e-e3e3-01771c069941@aklaver.com> <BYAPR08MB5014807E8AF95524A6A4F439AC890@BYAPR08MB5014.namprd08.prod.outlook.com> <d11cac74-fc57-6949-dfc5-cc50d0c0810d@aklaver.com> <15554.1568929375@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox