Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0TzD-0000qH-5z for pgsql-admin@arkaria.postgresql.org; Mon, 26 Mar 2018 15:24:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0TzB-0002KC-BZ for pgsql-admin@arkaria.postgresql.org; Mon, 26 Mar 2018 15:24:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0TzA-0002K2-Ui for pgsql-admin@lists.postgresql.org; Mon, 26 Mar 2018 15:24:37 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f0Tz2-0001O3-EB for pgsql-admin@postgresql.org; Mon, 26 Mar 2018 15:24:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To:Message-ID:Subject:Cc:To:Sender:From:Date; bh=GMpYigF+sB630X1RHwFdE5Y3x/+Qcx/QsqPc0mDXirA=; b=LEJNmZzfpUcFKXRDQM/LZxPhhkXiI5L1Ma3M9PEQmZlGzr7KVtEStPSi/woAWV1ocsITNjNlyCGSH0bx53QpmGlW6u7uIMCMMkTwu8uOGT1c42WRj8xe64tXSu5BP9GPoUSEZt109N+lAns6dXOGkEucn66Z6l6bU/7wbBtJCcY=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.84_2) (envelope-from ) id 1f0Tyz-0006eh-AG; Mon, 26 Mar 2018 17:24:25 +0200 Date: Mon, 26 Mar 2018 17:24:25 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Artem Tomyuk Cc: Keith , pgsql-admin Subject: Re: how to shrink pg_attribute table in some database Message-ID: <20180326152425.GA23643@depesz.com> Reply-To: depesz@depesz.com References: <20180326141756.GB708@depesz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Mar 26, 2018 at 05:33:19PM +0300, Artem Tomyuk wrote: > Can't, it generates huge IO spikes. > > But.... > > Few hours ago i manually started vacuum verbose on pg_attribute, now its > finished and i have some outputs: > > INFO: "pg_attribute": found 554728466 removable, 212058 nonremovable row > versions in 44550921 out of 49326696 pages DETAIL: 178215 dead row versions > cannot be removed yet. There were 53479 unused item pointers. 0 pages are > entirely empty. CPU 1097.53s/1949.50u sec elapsed 6337.86 sec. Query > returned successfully with no result in 01:47:3626 hours. > > what do you think? > > select count(*) on pg_attribute returns: > 158340 rows > > So as i understand vacuum full will create new pg_attribute and will wrote > those amount of "valid" rows, but still it will scan 300GB old table? > So estimate will be even ~same compering with regular vacuum? more or less, yes. the thing is - find and fix whatever is causing this insane churn of tables/attributes. Best regards, depesz