Re: How to write a script to analyze and vacuum all the tables in the system catalog?Thanks.

From: leaf_yxj <leaf_yxj(at)163(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to write a script to analyze and vacuum all the tables in the system catalog?Thanks.
Date: 2012-05-18 13:54:22
Message-ID: 78e35489.26967.1376039ef2c.Coremail.leaf_yxj@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks. Steve

At 2012-05-18 02:54:36,"Steve Crawford [via PostgreSQL]" <ml-node+s1045698n5709066h88(at)n5(dot)nabble(dot)com> wrote:
On 05/17/2012 11:30 AM, leaf_yxj wrote:
> Hi Guys. Please help me about this.
>
> For postgres database, it looks like we need analyze and vacuum all the
> tables periodly. I need to write a script which can be executed in crontab.
> I don't have any clues about that. I only know the command :
> analyze tablename;
> vacuum tablename;
Leave off the tablename to do the whole db. But (unless you are on a
really old version of PG) you really shouldn't need to manually vacuum
things as that is the job of the autovacuum process.

There are unusual situations that suggest a manual analyze. It should be
run right after a cluster for instance. But they are limited special cases.

What indicates that you need to vacuum or analyze via cron?

Cheers,
Steve

--
Sent via pgsql-general mailing list ([hidden email])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

If you reply to this email, your message will be added to the discussion below:
http://postgresql.1045698.n5.nabble.com/How-to-write-a-script-to-analyze-and-vacuum-all-the-tables-in-the-system-catalog-Thanks-tp5709059p5709066.html
To unsubscribe from How to write a script to analyze and vacuum all the tables in the system catalog?Thanks., click here.
NAML

--
View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-write-a-script-to-analyze-and-vacuum-all-the-tables-in-the-system-catalog-Thanks-tp5709059p5709117.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vincenzo Romano 2012-05-18 14:09:37 Re: How to check for server availability? [v9.3.1, Linux]
Previous Message leaf_yxj 2012-05-18 13:52:51 Re: How to debug the performance issues via which system catalog.Thanks.