bloat indicator using n_dead_tup column

From: Yambu <hyambu(at)gmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: bloat indicator using n_dead_tup column
Date: 2021-05-25 04:37:42
Message-ID: CALhHtcAWd+rfCnXA1-1p9DrqJ0fHpR+P3_GHrhgaVDx5myG5Yg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello

I would like to know if the below query can be used as a bloat indicator.

select
n_dead_tup
/ (n_live_tup * current_setting('autovacuum_vacuum_scale_factor')::float8
+ current_setting('autovacuum_vacuum_threshold')::float8) > 1 then true
else false end as bloated_indicator
FROM pg_stat_user_tables

i want to use column n_dead_tup to get an estimate or indicator of
impending bloat

regards

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Guillaume Lelarge 2021-05-25 06:25:21 Re: bloat indicator using n_dead_tup column
Previous Message Tom Lane 2021-05-24 18:24:47 Re: Creating an index on a timestamp with time zone cast to a date-- possible?