Re: Fragmentation/Vacuum, Analyze, Re-Index

From: Richard Neill <rn214(at)cam(dot)ac(dot)uk>
To: DM <dm(dot)aeqa(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Fragmentation/Vacuum, Analyze, Re-Index
Date: 2010-01-22 19:27:27
Message-ID: 4B59FC1F.6050404@cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

DM wrote:
> Is there any script/tool to identify if the table requires full vacuum?
> or to re-index an existing index table?
>

Don't know if there is a script to specifically do this, though you may
find this query a useful one:

SELECT relname, reltuples, relpages FROM pg_class ORDER BY relpages DESC;

(it shows what's currently using most of the disk).

In general though, you should never use "VACUUM FULL". The best bet is
to tune autovacuum to be more aggressive, and then occasionally run CLUSTER.

Best wishes,

Richard

> Thanks
> Deepak
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2010-01-22 19:29:08 Re: Slow Query / Check Point Segments
Previous Message Tom Lane 2010-01-22 19:26:53 Re: Old/New

Browse pgsql-performance by date

  From Date Subject
Next Message fkater@googlemail.com 2010-01-22 20:42:03 Re: Inserting 8MB bytea: just 25% of disk perf used?
Previous Message Tory M Blue 2010-01-22 19:08:02 Re: Data Set Growth causing 26+hour runtime, on what we believe to be very simple SQL