Re: Need help to make space on my database

From: Kashif Zeeshan <kashi(dot)zeeshan(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "Cocam' server" <cocamserver(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Need help to make space on my database
Date: 2024-04-29 14:25:57
Message-ID: CAAPsdhf9PWvmM5Jdg31D-oVX6XTshpn-HfmnT47ZUBWOebRUfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Please run VACUUM with ANALYZE option that will also update the DB Stats.

Regards
Kashif Zeeshan
Bitnine Global

On Mon, Apr 29, 2024 at 7:19 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 4/29/24 06:45, Cocam' server wrote:
> > Hello.
> >
> > I need help to make space on my database. I have tables that are several
> > GB in size. I used to use the VACUUM FULL VERBOSE command; but now, this
> > command is too greedy in free space to be used and I'm looking for a way
> > to make free space (given back to the OS)
> >
> > Thanks in advance to everyone who responds
>
> Per
>
> https://www.postgresql.org/docs/current/sql-vacuum.html
>
> "VACUUM reclaims storage occupied by dead tuples. In normal PostgreSQL
> operation, tuples that are deleted or obsoleted by an update are not
> physically removed from their table; they remain present until a VACUUM
> is done. Therefore it's necessary to do VACUUM periodically, especially
> on frequently-updated tables.
>
> <...>
>
> Plain VACUUM (without FULL) simply reclaims space and makes it available
> for re-use. This form of the command can operate in parallel with normal
> reading and writing of the table, as an exclusive lock is not obtained.
> However, extra space is not returned to the operating system (in most
> cases); it's just kept available for re-use within the same table.
> "
>
> So a regular VACUUM should work if all you want to do is give the
> database the ability to recycle the vacuumed tuple space.
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-04-29 14:37:54 Re: Need help to make space on my database
Previous Message Adrian Klaver 2024-04-29 14:19:00 Re: Need help to make space on my database