Re: checking for table bloat - Mailing list pgsql-general

From Ondrej Ivanič
Subject Re: checking for table bloat
Date
Msg-id CAM6mieLXDPrWvChvRuunDPGB4+QZdOeE=K3n3TX=iMw8qNai=Q@mail.gmail.com
Whole thread Raw
In response to checking for table bloat  (Ben Chobot <bench@silentmedia.com>)
List pgsql-general
Hi

> As I'm sure many people know, check_postgres.pl has a wonderful (if rather
> arcane) query to check table bloat, which has been copied all over the
> intarwebz. When I try to use this query one one of my databases I'm told my
> table (which has had no deletes) is wasting a whole lot of bytes, but no
> amount of vacuuming or even clustering will make it less bloated.

You can use CTAS and re-create that table. The main issue with "check
bloat" query is that you can't relay on absolute numbers. You should
look the difference over the time (ie. run it once a day) and compare
that number to database activity (pg_stat_all_tables - n_tup_*
columns))

--
Ondrej Ivanic
(ondrej.ivanic@gmail.com)

pgsql-general by date:

Previous
From: Ben Chobot
Date:
Subject: checking for table bloat
Next
From: karthikeyan
Date:
Subject: Unable to Increase the column which was part of Primary key