Re: Know bloat percentage after auto vacuum

From: Keith <keith(at)keithf4(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: satish v <vuyyuru(dot)satish59(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Know bloat percentage after auto vacuum
Date: 2021-11-10 05:09:27
Message-ID: CAHw75vt56gS615sNLrfzaUnEQ9aQB4rKEZz-gyUHmEwiOfOvdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Nov 1, 2021 at 12:35 AM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> On Sat, 2021-10-30 at 21:33 +0530, satish v wrote:
> > We have the table with 2 months data (approx 450GB). We deleted 17 days
> of data and auto vacuum
> > performed on the table.new insertions are utilizing that space,we want
> to perform the vacuum full
> > and reclaim the space at os level but don't know how much free (unused)
> space available.how can we get the details.
>
> CREATE EXTENSION pgstattuple;
>
> SELECT tuple_percent, dead_tuple_percent, free_percent
> FROM pgstattuple('table_name');
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>
Note that pgstattuple('tablename') will only show the bloat on the table
itself and not the indexes, nor any possibly associated TOAST tables.

Script I've been working on tries to help make pgstattuple a little more
useful by scanning all relevant pieces that it can for a given table.

https://github.com/keithf4/pg_bloat_check

Keith

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ruohang Feng 2021-11-10 06:13:53 Re: Best Prometheus exporter?
Previous Message Holger Jakobs 2021-11-09 19:32:46 Re: Ubuntu Upgrade from 18.04 to 20.04 failed due to Postgres/Postgis package on removal blacklist.