Re: Observation with Postgres table size - Mailing list pgsql-admin

From Scott Ribe
Subject Re: Observation with Postgres table size
Date
Msg-id A261A0D0-9868-4096-8F64-C966C8DB129C@elevated-dev.com
Whole thread Raw
In response to Observation with Postgres table size  (Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com>)
List pgsql-admin
> On May 10, 2024, at 7:57 AM, Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com> wrote:
>
> 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.

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
tableto be rewritten? Do you expect the file to be rewritten every time a row is deleted? On commit of any transaction
thatincluded a delete? 

Postgres will eventually reuse the space left behind by deleted rows (read the docs for VACUUM), so under most use
casesthis is not a problem. 


pgsql-admin by date:

Previous
From: Sabyasachi Mukherjee
Date:
Subject: Observation with Postgres table size
Next
From: Laurenz Albe
Date:
Subject: Re: Observation with Postgres table size