pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Know bloat percentage after auto vacuum
3+ messages / 3 participants
[nested] [flat]

* Know bloat percentage after auto vacuum
@ 2021-10-30 16:03  satish v <vuyyuru.satish59@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: satish v @ 2021-10-30 16:03 UTC (permalink / raw)
  To: pgsql-admin

Hi all.

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.

Thanks in advance.

Regards,
Satish.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Know bloat percentage after auto vacuum
@ 2021-11-01 04:35  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: satish v <vuyyuru.satish59@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurenz Albe @ 2021-11-01 04:35 UTC (permalink / raw)
  To: satish v <vuyyuru.satish59@gmail.com>; pgsql-admin

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






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Know bloat percentage after auto vacuum
@ 2021-11-10 05:09  Keith <keith@keithf4.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 3+ messages in thread

From: Keith @ 2021-11-10 05:09 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: satish v <vuyyuru.satish59@gmail.com>; pgsql-admin

On Mon, Nov 1, 2021 at 12:35 AM Laurenz Albe <laurenz.albe@cybertec.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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-11-10 05:09 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-30 16:03 Know bloat percentage after auto vacuum satish v <vuyyuru.satish59@gmail.com>
2021-11-01 04:35 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-11-10 05:09   ` Keith <keith@keithf4.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox