Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iB4JN-0000XU-11 for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 21:50:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iB4JK-0000uS-Vi for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 21:49:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iB4JK-0000uJ-Bz for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 21:49:58 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iB4JD-0001w5-1D for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 21:49:57 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B714A21CC3; Thu, 19 Sep 2019 17:49:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 19 Sep 2019 17:49:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=X V2QuGzy/wK2a3flsZozncEN7nypn+A+Ip8L7GRcv+8=; b=tPkoIbn20npW/hYMq cOFpbJcWI4zgGRudR4fswdi5oJurqTFeT++Hn2986i6HZLcVJIWpM5sWIgpNIpv6 xpiW5BziUOcWgrifgLi2nexDgbEC5dfGSJf6ICyFedwUNVEHUS5qVEJ9FtD4YLpP +18xk/rfS/0TrqRROHnc8B21qU/yD3bkkI7xbP+THIUo8e6b4tJr8MmWTHyiOQd7 G1+19Buv2vsvOOsW4vUabt5/m4Js3OksQEjDH0tMoYu3TQ0D1kp7d7JBrU+Hw2vG dTohyhVyYyfKLMJEtQOHrCFEdu0SLNnDCV1p/9ykZkiQ69vL09PgQ7ad43shxT6f 4yrkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=XV2QuGzy/wK2a3flsZozncEN7nypn+A+Ip8L7GRcv +8=; b=RVK7oomwydXL1aXHArEQch7fD1KBx5FrZ43HaivCmc6wqn5M/2O3PXrV9 iURk236Vfm7obKUXsanXGZsi/ZLY5JEjis2mWGs1laQrKknT7B1nPiSJYLr1LO+6 mkISncqDIo/icZdtU16LZxkLkrsQJxcF3Bup+IABtudiAI1JeDWlK8bi2uLMe5s5 mo6PPlBAY1OnTVAQfo94a6EAtpS8kmj82lwSEmMyKhMroRxHUMccxUx3fCbmjZKk fAvlH4lEoHWNDGVFhge85gqIBvLY8mzmm1/ZFKQ9lnW4rBq/n8nS09KQJiQewesi 9Ii/NAyrxIGDXeojwAxrwxP8A/Oqg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddugddtvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthejre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucfkphepjeegrdelgedrjeefrddvvddvne curfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghv vghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id D39348005C; Thu, 19 Sep 2019 17:49:48 -0400 (EDT) Subject: Re: is it safe to drop 25 tb schema with cascade option? To: Tom Lane Cc: Julie Nishimura , "pgsql-general@lists.postgresql.org" References: <71b7be3f-6f7f-cce4-ce76-87febd8295b0@aklaver.com> <15554.1568929375@sss.pgh.pa.us> From: Adrian Klaver Message-ID: Date: Thu, 19 Sep 2019 14:49:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <15554.1568929375@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 9/19/19 2:42 PM, Tom Lane wrote: > Adrian Klaver 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. So this is the part I need some clarification on. If you start vacuuming the tables that are setting the min then that should buy you some time? > > 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 > -- Adrian Klaver adrian.klaver@aklaver.com