Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFkIk-0002sV-Ce for pgsql-admin@arkaria.postgresql.org; Mon, 16 Aug 2021 21:37:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mFkIj-0001td-Bd for pgsql-admin@arkaria.postgresql.org; Mon, 16 Aug 2021 21:37:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFhhU-0007OL-1Z for pgsql-admin@lists.postgresql.org; Mon, 16 Aug 2021 18:51:08 +0000 Received: from 83-160-143-48.ip.xs4all.nl ([83.160.143.48] helo=mail.osdev.nl) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFhhN-0004MG-G0 for pgsql-admin@lists.postgresql.org; Mon, 16 Aug 2021 18:51:06 +0000 Received: from optiplex64.osdev.nl (83-160-143-48.ip.xs4all.nl [83.160.143.48]) (authenticated bits=0) by mail.osdev.nl (8.15.2/8.15.2) with ESMTPSA id 17GIow3V270309 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 16 Aug 2021 20:50:58 +0200 Message-ID: <0d8fcf46441c7ba47702bd7d886b1c419e6f73d4.camel@osdev.nl> Subject: Re: After vacuum db size is increasing From: "Peter M. Groen" To: srijith s , pgsql-admin@lists.postgresql.org Date: Mon, 16 Aug 2021 20:50:58 +0200 In-Reply-To: <7C3DCEF8-BBCF-4E92-B330-1D83121E638B@gmail.com> References: <7C3DCEF8-BBCF-4E92-B330-1D83121E638B@gmail.com> Organization: Open Systems Development B.V. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.osdev.nl [192.168.1.22]); Mon, 16 Aug 2021 20:50:58 +0200 (CEST) X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on andromeda.osdev.nl List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk It is a misconception that VACUUM will decrease allocated diskspace. PG is allocating tablespace, used by data or not. If it needs more, it will extend those. Downsize of this ( pun intended ) that tablespaces normally *don't* shrink. You saying your database is only using 80Gb but this is only 80Gb of *data*. That 80Gb is probably used within the tablespace mentioned. I don;t know the setup of your database but it sounds to me, your tablespace is extended during the VACUUM operation for whatever reason.. (Temporary space?) It seems odd to me that it "adds" the exact amount of space as it was initially... -- Open Systems Development B.V. Peter M. Groen ( Managing Director ) Rooseveltstraat 18-P 2321 BM Leiden Mob : +31 6 81 10 35 37 Email : peter@osdev.nl Slype : peter_m_groen On Mon, 2021-08-16 at 12:20 -0400, srijith s wrote: > Hi Postgres Admins > > Any help is much appreciated . When i am running vacuum full, the > database size is getting increased a lot, my database was around > 100gb and when i did vacuum full on the large table ( which consume > 95% of data in the database) , database size become 200+ gb , then i > did a full vacuum on the database itself and that made the db grow to > 300+gb 🙄 and filled my data drive . > The large table size is showing only 80gb. > > I am running Postgres on windows. Anybody know why its behaving like > this > > Thanks in advance > Regards > Sri > > > > > > Sent from my iPhone > >