Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s5QoD-005MDB-F9 for pgsql-admin@arkaria.postgresql.org; Fri, 10 May 2024 14:01:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s5QoA-00Fktq-QG for pgsql-admin@arkaria.postgresql.org; Fri, 10 May 2024 14:01:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s5QoA-00Fktg-F5 for pgsql-admin@lists.postgresql.org; Fri, 10 May 2024 14:01:10 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s5Qo5-000MIB-Ac for pgsql-admin@lists.postgresql.org; Fri, 10 May 2024 14:01:10 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 0AE736F271; Fri, 10 May 2024 14:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1715349664; bh=W9c3V5LDky1focouYugzuD4FAPrgv66jrNSXDwS28NE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=fMXfed88S/+RW+gcXnKH0t0hw7dyAq+7jLwzJce2lYETIIRAe3A/yZQxhLCQArxhL XApYbvRStegPaTL1xgKsphwbsQ9UFdX5iVokaQAPskZSeK7jkkO1t59CvAGBOXYhCl F2EIz7M79nZw83ihOKkEbt1qkanozwgYu5IQeRBbqVThd1OV23dnVXud//FL68m42M q2WSgOJ4FxKY2dn9h5+Vch6xboC1Xo13WFY6Uh6PYs/5V6IZ4Gs1/ihtmu7yVlCt9f RtPXe1owcB6jKJiOh1VHV23f3wBpVngeT9cNOhG1znNn6Mr2m6229S4jFTgBk8IKSo n6X0gn54DDJkQ== X-Virus-Scanned: Debian amavisd-new at emo09-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo09-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2jwHyP51W10M; Fri, 10 May 2024 14:01:02 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id C829F6EED5; Fri, 10 May 2024 14:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1715349661; bh=W9c3V5LDky1focouYugzuD4FAPrgv66jrNSXDwS28NE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=xobCWLdVASOoHg4AY5+3T/xdu1kauRot+gX+aI+4/amI1sxVgjvs3Q0iGqmNs+r3L ia30LheK5ybeMB8HjTMzjLZ6QL10G21le4wYRShfbFJ8oUp80cLX9ZC2iDlTEJ9UyZ I4HBpwHf75c7PNy66MmiuRgu3YDlTR91pe7SN3hoBs3trhte0toX876R6A7g5qupX8 MSjSfZT+jlek6+X2Xc6dkJ6BTZdEivJvjCyDy7232lh11aeoIUPPbukikRHoon1fK0 2N1flFvlLst6fmA2rLKk7SkNhjTt2phtCXhaW7Higq+gGXLDxb4++AStArF3mMlkGh uvN+kEf8BO/ZQ== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: Observation with Postgres table size From: Scott Ribe In-Reply-To: Date: Fri, 10 May 2024 08:00:51 -0600 Cc: "pgsql-admin@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Sabyasachi Mukherjee X-Mailer: Apple Mail (2.3774.500.171.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On May 10, 2024, at 7:57=E2=80=AFAM, Sabyasachi Mukherjee = wrote: >=20 > Can any body please advise, how to reduce the size of the table? VACUUM FULL Read the docs to understand what it does. Deleting a row does not shrink = the table.=20 Think about it, what happens when you delete a row that's first in the = file on disk? Do you expect the rest of the table to be rewritten? Do = you expect the file to be rewritten every time a row is deleted? On = commit of any transaction that included a delete? Postgres will eventually reuse the space left behind by deleted rows = (read the docs for VACUUM), so under most use cases this is not a = problem.=