pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Browne <cbbrowne@acm.org>
To: pgsql-admin@postgresql.org
Subject: Re: Is the database being VACUUMed?
Date: Fri, 10 Feb 2006 15:17:57 -0500
Message-ID: <6064nneznu.fsf@dba2.int.libertyrms.com> (raw)
References: <2894.134.244.169.17.1139587037.squirrel@webmail.stinkweasel.net>

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?"



view thread (5+ messages)  latest in thread

Message-ID: <6064nneznu.fsf@dba2.int.libertyrms.com>
Permalink:  ../6064nneznu.fsf@dba2.int.libertyrms.com/
Also on:    postgresql.org/message-id/6064nneznu.fsf@dba2.int.libertyrms.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: cbbrowne@acm.org
  Subject: Re: Is the database being VACUUMed?
  In-Reply-To: <6064nneznu.fsf@dba2.int.libertyrms.com>
  References: <2894.134.244.169.17.1139587037.squirrel@webmail.stinkweasel.net> <6064nneznu.fsf@dba2.int.libertyrms.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