X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id F17A09DC855 for ; Fri, 10 Feb 2006 17:08:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 11823-01 for ; Fri, 10 Feb 2006 17:08:57 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id 9D4969DCD23 for ; Fri, 10 Feb 2006 17:08:54 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.13.1/8.13.1) with ESMTP id k1AL8rOJ069397 for ; Fri, 10 Feb 2006 21:08:53 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.13.1/8.13.1/Submit) id k1AL40W6068751 for pgsql-admin@postgresql.org; Fri, 10 Feb 2006 17:04:00 -0400 (AST) (envelope-from news) From: Chris Browne X-Newsgroups: pgsql.admin Subject: Re: Is the database being VACUUMed? Date: Fri, 10 Feb 2006 15:17:57 -0500 Organization: cbbrowne Computing Inc Lines: 34 Message-ID: <6064nneznu.fsf@dba2.int.libertyrms.com> References: <2894.134.244.169.17.1139587037.squirrel@webmail.stinkweasel.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.18 (linux) Cancel-Lock: sha1:H9zoG8i7+NEcxM1qRyIre3gHGKA= To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=-1.273 required=5 tests=[ALL_TRUSTED=-1.44, AWL=0.167] X-Spam-Score: -1.273 X-Spam-Level: X-Archive-Number: 200602/113 X-Sequence-Number: 20534 benny@bennyvision.com ("C. Bensend") writes: > Hey folks, > > I'm running 8.0.4 on OpenBSD, and I'm running into issues where > a large batch job will fire up and occasionally coincide with a > VACUUM. Which then makes this batch take an hour and a half, > rather than the 30 minutes it usually takes. :( > > I am going to upgrade to 8.1.2 this weekend, before you ask. :) > > Here's the question - is there a query I can make in my scripts > (using perl/DBD::Pg) to see if the database is being VACUUMed at > the current time? I could add a sleep, so the script would > patiently wait for the VACUUM to finish before kicking off several > intense queries. > > Thanks much! If you have command string monitoring turned on, via stats_command_string in the postgresql.conf file, then you could get this information from the system view pg_stat_activity. Generally, you could look to see if a current_query is a vacuum, perhaps via... select * from pg_stat_activity where lower(current_query) like 'vacuum%' ; If that parameter is not turned on, then ps auxww | egrep [something finding your PG processes] | grep VACUUM could perhaps do the trick, albeit not from a straightforward database query... -- output = ("cbbrowne" "@" "acm.org") http://www.ntlug.org/~cbbrowne/advocacy.html "Is your pencil Y2K certified? Do you know the possible effects if it isn't?"