Thread: Distinguishing autovacuum activity in pg_stat_activity

Distinguishing autovacuum activity in pg_stat_activity

From
Tom Lane
Date:
I was just noticing that $SUBJECT is hard --- the entry in current_query
looks exactly like a manual vacuum command, and there's not anything in
the other fields that looks different either.

Since autovacuum.c is making up its pgstat_report_activity string
anyway, it would be easy to make the string look like, say,AUTO VACUUM ANALYZE foo.bar

I think this would be a helpful change, but some might find it
confusing.  Thoughts?
        regards, tom lane


Re: Distinguishing autovacuum activity in pg_stat_activity

From
"Guillaume Smet"
Date:
On Jan 13, 2008 10:59 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I think this would be a helpful change, but some might find it
> confusing.  Thoughts?

If possible, something like:
autovacuum: VACUUM ANALYZE foo.bar
could be less confusing.
It's weird to just add AUTO in front of the query.

--
Guillaume


Re: Distinguishing autovacuum activity in pg_stat_activity

From
"Joshua D. Drake"
Date:
Tom Lane wrote:
> I was just noticing that $SUBJECT is hard --- the entry in current_query
> looks exactly like a manual vacuum command, and there's not anything in
> the other fields that looks different either.
> 
> Since autovacuum.c is making up its pgstat_report_activity string
> anyway, it would be easy to make the string look like, say,
>     AUTO VACUUM ANALYZE foo.bar
> 
> I think this would be a helpful change, but some might find it
> confusing.  Thoughts?

I find

AUTOVACUUM ANALYZE foo.bar more clear.

Joshua D. Drake

> 
>             regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faq
> 



Re: Distinguishing autovacuum activity in pg_stat_activity

From
"Guillaume Smet"
Date:
On Jan 13, 2008 11:27 PM, Joshua D. Drake <jd@commandprompt.com> wrote:
> AUTOVACUUM ANALYZE foo.bar more clear.

Doesn't autovacuum also trigger ANALYZE only?

That's why I proposed an 'autovacuum:' prefix.

--
Guillaume


Re: Distinguishing autovacuum activity in pg_stat_activity

From
"Joshua D. Drake"
Date:
Guillaume Smet wrote:
> On Jan 13, 2008 11:27 PM, Joshua D. Drake <jd@commandprompt.com> wrote:
>> AUTOVACUUM ANALYZE foo.bar more clear.
> 
> Doesn't autovacuum also trigger ANALYZE only?
> 
> That's why I proposed an 'autovacuum:' prefix.

Oh so:

autovacuum: vacuum
autovacuum: analyze
autovacuum: vacuum analyze

Yeah that's cool.

Joshua D. Drake



> 
> --
> Guillaume
> 



Re: Distinguishing autovacuum activity in pg_stat_activity

From
Alvaro Herrera
Date:
Guillaume Smet escribió:
> On Jan 13, 2008 10:59 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > I think this would be a helpful change, but some might find it
> > confusing.  Thoughts?
> 
> If possible, something like:
> autovacuum: VACUUM ANALYZE foo.bar
> could be less confusing.
> It's weird to just add AUTO in front of the query.

Whether the string is "AUTO " or "autovacuum: " seems rather the same
thing to me :-)  I agree with the general idea.  I think "autovacuum: "
makes it clearer that it's not part of the actual command syntax, so
maybe I'll put half a vote for that option.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


Re: Distinguishing autovacuum activity in pg_stat_activity

From
"Guillaume Smet"
Date:
On Jan 14, 2008 1:31 AM, Alvaro Herrera <alvherre@commandprompt.com> wrote:
> Whether the string is "AUTO " or "autovacuum: " seems rather the same
> thing to me :-)  I agree with the general idea.

Yeah, forgot to mention I find it a very good idea.

--
Guillaume


Re: Distinguishing autovacuum activity in pg_stat_activity

From
Tom Lane
Date:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Whether the string is "AUTO " or "autovacuum: " seems rather the same
> thing to me :-)  I agree with the general idea.  I think "autovacuum: "
> makes it clearer that it's not part of the actual command syntax, so
> maybe I'll put half a vote for that option.

Okay by me.  Do you want to make the change?
        regards, tom lane


Re: Distinguishing autovacuum activity in pg_stat_activity

From
Alvaro Herrera
Date:
Tom Lane escribió:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Whether the string is "AUTO " or "autovacuum: " seems rather the same
> > thing to me :-)  I agree with the general idea.  I think "autovacuum: "
> > makes it clearer that it's not part of the actual command syntax, so
> > maybe I'll put half a vote for that option.
> 
> Okay by me.  Do you want to make the change?

Will do (early tomorrow)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.