From: Kevin Kempter <kevin@kevinkempterllc.com>
To: pgsql-admin@postgresql.org
Subject: determining which table is being vacuumed by autovacuum
Date: Wed, 22 Aug 2007 15:25:45 -0600
Message-ID: <200708221525.45292.kevin@kevinkempterllc.com> (raw)
Hi List;
I want to determine which table is being vacuumed.
I ran this:
postgres=# select procpid, current_query from pg_stat_activity where
current_query = 'VACUUM';
procpid | current_query
---------+---------------
9902 | VACUUM
(1 row)
Then I ran this:
postgres=# select relation from pg_locks where pid = 9902;
relation
-----------
82097999
143763216
143763215
143763193
143763193
143763217
(7 rows)
However none of these seem to have a corresponding pg_class oid, see the below
queries:
postgres=# select relation::regclass from pg_locks where pid = 9902;
relation
-----------
82097999
143763216
143763215
143763193
143763193
143763217
(7 rows)
postgres=# select relname from pg_class where oid in (select relation from
pg_locks where pid = 9902);
relname
---------
(0 rows)
2 questions:
1) Is this normal, as in are there normally relation values in pg_locks that
are not meant to correspond to a pg_class oid (i.e. a table name)
2) Is this the best way to determine which table is currently being vacuumed?
Thanks in advance...
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: kevin@kevinkempterllc.com
Subject: Re: determining which table is being vacuumed by autovacuum
In-Reply-To: <200708221525.45292.kevin@kevinkempterllc.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox