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

From: Steve Crawford <scrawford(at)pinpointresearch(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 15:07:36
Message-ID: 4FB665B8.9070601@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/18/2012 06:47 AM, yxj wrote:
> Hi Steve,
> Thanks for your reply.
> My Postgresql version is 8.2. I amn't sure we have the autovacuum job
> running or not? How can I check it ?
>
Unless something is broken it is already running. You can connect to the
db and run "show autovacuum;". It should be on.

Alternately, run "show all;" and scroll down to look at all the
autovacuum settings.

You can also check the running processes. On *nix: if you run "ps -ef |
grep postgres" (assuming typical setups where PostgreSQL is running as
the postgres user) you will see something like:
postgres 14698 1 0 Jan10 ? 01:20:57 /usr/bin/postgres -p 5432 -D
/var/lib/pgsql/data
postgres 14700 14698 0 Jan10 ? 00:07:20 postgres: writer process
postgres 14701 14698 0 Jan10 ? 00:03:09 postgres: wal writer process
postgres 14702 14698 0 Jan10 ? 00:00:21 postgres: autovacuum launcher
process
postgres 14703 14698 0 Jan10 ? 00:51:48 postgres: stats collector process
...

The "autovacuum launcher process" is the one that handles automatically
running vacuum when it is appropriate.

Cheers,
Steve

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Blackwell 2012-05-18 15:14:23 Log: Untranslatable character: no DETAIL
Previous Message Chris Angelico 2012-05-18 14:18:21 Re: How to check for server availability? [v9.3.1, Linux]