Re: How do I know my table is bloated?

From: Rodrigo Barboza <rodrigombufrj(at)gmail(dot)com>
To: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How do I know my table is bloated?
Date: 2013-05-31 05:09:06
Message-ID: CANs8QJbPA7f_9aO1e7u3WghBhodMWWO0zFWi=siPXFp_RQ6Muw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, May 31, 2013 at 2:06 AM, Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> wrote:

> On Thu, May 30, 2013 at 6:05 AM, Rodrigo Barboza
> <rodrigombufrj(at)gmail(dot)com> wrote:
> > I saw some people talking about the reindex command and I read in the
> docs
> > the one reason to use reindex is when a table is bloated.
> > But how do I know when a table is bloated?
>
> Take a look at the pgcompactor tool
> https://code.google.com/p/pgtoolkit/. This will find out what tables
> and indexes in your cluster are bloated and softly (without heavy
> locks) remove the bloat. Before using it setup the pgstattuple
> extension in all the databases you age going to check for bloat. Some
> usage examples are below.
>
> To get bloat statistics for all the cluster do:
>
> pgcompactor --all --reindex --verbose info --dry-run
>
> To remove bloat from all the cluster:
>
> pgcompactor --all --reindex --verbose info
>
> For a specific table use:
>
> pgcompactor --table tablename --reindex --verbose info --dry-run
>
> You can also specify --dbname, --schema, --exclude-<dbname/schema/table>,
> etc.
>
> For all the options:
>
> pgcompactor --man
>
> --
> Kind regards,
> Sergey Konoplev
> PostgreSQL Consultant and DBA
>
> Profile: http://www.linkedin.com/in/grayhemp
> Phone: USA +1 (415) 867-9984, Russia +7 (901) 903-0499, +7 (988) 888-1979
> Skype: gray-hemp
> Jabber: gray(dot)ru(at)gmail(dot)com
>

Thanks, guys!

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Sergey Konoplev 2013-05-31 05:30:22 Re: Standby doesn't chose a new timeline when promoted to master
Previous Message Sergey Konoplev 2013-05-31 05:06:22 Re: How do I know my table is bloated?