Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 29C3C9F96F3 for ; Wed, 22 Aug 2007 18:26:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 02730-06 for ; Wed, 22 Aug 2007 18:26:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from outbound-mail-67.bluehost.com (outbound-mail-67.bluehost.com [69.89.21.27]) by postgresql.org (Postfix) with SMTP id 852369F96DB for ; Wed, 22 Aug 2007 18:26:26 -0300 (ADT) Received: (qmail 6184 invoked by uid 0); 22 Aug 2007 21:26:25 -0000 Received: from unknown (HELO box54.bluehost.com) (69.89.20.54) by mailproxy4.bluehost.com with SMTP; 22 Aug 2007 21:26:25 -0000 Received: from rrcs-71-41-16-51.sw.biz.rr.com ([71.41.16.51] helo=[10.0.12.106]) by box54.bluehost.com with esmtp (Exim 4.66) (envelope-from ) id 1INxiZ-0003yY-IZ for pgsql-admin@postgresql.org; Wed, 22 Aug 2007 15:26:24 -0600 From: Kevin Kempter To: pgsql-admin@postgresql.org Subject: determining which table is being vacuumed by autovacuum Date: Wed, 22 Aug 2007 15:25:45 -0600 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708221525.45292.kevin@kevinkempterllc.com> X-Identified-User: {840:box54.bluehost.com:kevinkem:kevinkempterllc.com} {sentby:bopbeforesmtp 71.41.16.51 authed with ossfusion.com} X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.131 tagged_above=0 required=5 tests=BAYES_50=0.001, DNS_FROM_OPENWHOIS=1.13 X-Spam-Level: * X-Archive-Number: 200708/279 X-Sequence-Number: 26610 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...