Is autovacuum on?

Started by Blair Bethwaiteabout 18 years ago5 messagesgeneral
Jump to latest
#1Blair Bethwaite
blair.bethwaite@infotech.monash.edu.au

Hi all,

I've just upgraded to 8.3 and am looking at using autovacuum. We have
a long running application with high update frequency that
periodically issues vacuum commands itself. I'd like to be able to add
code to the app like:
if pg.autovacuum == "on":
self.routine_vacuuming = False
else:
self.routine_vacuuming = True
so that we can avoid manually issuing vacuum commands at sites where
Postgresql is running autovacuum.
But so far I haven't been able to find a way for a non-privileged user
to query the autovacuum status, is this possible?

Also, the routine-vacuuming section of the manual states that the
purpose of the autovacuum daemon is to periodically issue VACUUM and
ANALYZE commands - am I correct in thinking this implies that it will
not issue VACUUM FULL commands?

Cheers,
-Blair

--
In science one tries to tell people, in such a way
as to be understood by everyone, something that
no one ever knew before. But in poetry, it's the
exact opposite.
- Paul Dirac

#2Filip Rembiałkowski
plk.zuber@gmail.com
In reply to: Blair Bethwaite (#1)
Re: Is autovacuum on?

2008/3/18, Blair Bethwaite <blair.bethwaite@infotech.monash.edu.au>:

Hi all,

I've just upgraded to 8.3 and am looking at using autovacuum. We have
a long running application with high update frequency that
periodically issues vacuum commands itself. I'd like to be able to add
code to the app like:
if pg.autovacuum == "on":
self.routine_vacuuming = False
else:
self.routine_vacuuming = True
so that we can avoid manually issuing vacuum commands at sites where
Postgresql is running autovacuum.
But so far I haven't been able to find a way for a non-privileged user
to query the autovacuum status, is this possible?

yes.
select setting from pg_settings where name = 'autovacuum';

Also, the routine-vacuuming section of the manual states that the
purpose of the autovacuum daemon is to periodically issue VACUUM and
ANALYZE commands - am I correct in thinking this implies that it will
not issue VACUUM FULL commands?

Yes, you're correct.

--
Filip Rembiałkowski

#3Blair Bethwaite
blair.bethwaite@gmail.com
In reply to: Filip Rembiałkowski (#2)
Re: Is autovacuum on?

On Tue, Mar 18, 2008 at 3:20 PM, Filip Rembiałkowski
<plk.zuber@gmail.com> wrote:

yes.
select setting from pg_settings where name = 'autovacuum';

Ah ha, thankyou! I assumed there must have been a view for the
settings, I guess I missed it when I looked at the various pg_* views.

Cheers,
-Blair

--
In science one tries to tell people, in such a way
as to be understood by everyone, something that
no one ever knew before. But in poetry, it's the
exact opposite.
- Paul Dirac

#4Erik Jones
erik@myemma.com
In reply to: Blair Bethwaite (#3)
Re: Is autovacuum on?

On Mar 17, 2008, at 11:25 PM, Blair Bethwaite wrote:

On Tue, Mar 18, 2008 at 3:20 PM, Filip Rembiałkowski
<plk.zuber@gmail.com> wrote:

yes.
select setting from pg_settings where name = 'autovacuum';

Ah ha, thankyou! I assumed there must have been a view for the
settings, I guess I missed it when I looked at the various pg_* views.

Or, a simple:

SHOW autovacuum;

will to the trick. http://www.postgresql.org/docs/8.2/interactive/sql-show.html

Erik Jones

DBA | Emma®
erik@myemma.com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

#5Blair Bethwaite
blair.bethwaite@infotech.monash.edu.au
In reply to: Erik Jones (#4)
Re: Is autovacuum on?

On Wed, Mar 19, 2008 at 1:29 AM, Erik Jones <erik@myemma.com> wrote:

SHOW autovacuum;

That's even better, thanks Erik.

Cheers,
-Blair

--
In science one tries to tell people, in such a way
as to be understood by everyone, something that
no one ever knew before. But in poetry, it's the
exact opposite.
- Paul Dirac