Re: [HACKERS] [PATCH] Addition of some trivial auto vacuum logging

2011-09-27 Thread Tom Lane
Royce Ausburn royce...@inomial.com writes:
  The attached patch adds extra detail the the existing autovacuum log message 
 that is emitted when the log_autovacuum_min_duration threshold is met, 
 exposing the unremovable dead tuple count similar to what you get from VACUUM 
 VERBOSE.

 Sample log output (my addition in bold):

 LOG:  automatic vacuum of table test.public.test: index scans: 0
   pages: 0 removed, 5 remain
   tuples: 0 removed, 1000 remain, 999 dead but not removable
   system usage: CPU 0.00s/0.00u sec elapsed 0.00 sec

This proposal seems rather ill-designed.  In the first place, these
numbers are quite unrelated to vacuum duration, and in the second place,
most people who might need the info don't have that setting turned on
anyway.

I wonder whether it wouldn't be more helpful to have a pg_stat_all_tables
column that reports the number of unremovable tuples as of the last
vacuum.  I've been known to object to more per-table stats counters
in the past on the basis of space required, but perhaps this one would
be worth its keep.

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [PATCH] Addition of some trivial auto vacuum logging

2011-09-27 Thread Kevin Grittner
Royce Ausburn royce...@inomial.com wrote:
 
 As this is my first patch to postgresql, I'm expecting I've done
 something wrong.  Please if you want me to fix something up, or
 just go away please say so ;)  I appreciate that this is a trivial
 patch, and perhaps doesn't add value except for my very specific
 use case* feel free to ignore it =)
 
Thanks for offering this to the community.  I see you've already
gotten feedback on the patch, with a suggestion for a different
approach.  Don't let that discourage you -- very few patches get in
without needing to be modified based on review and feedback.
 
If you haven't already done so, please review this page and its
links:
 
http://www.postgresql.org/developer/
 
Of particular interest is the Developer FAQ:
 
http://wiki.postgresql.org/wiki/Developer_FAQ
 
You should also be aware of the development cycle, which (when not
in feature freeze for beta testing) involves alternating periods of
focused development and code review (the latter called CommitFests):
 
http://wiki.postgresql.org/wiki/CommitFest
 
We are now in the midst of a CF, so it would be great if you could
join in that as a reviewer.  Newly submitted patches should be
submitted to the open CF:
 
http://commitfest.postgresql.org/action/commitfest_view/open
 
You might want to consider what Tom said and submit a modified patch
for the next review cycle.
 
Welcome!
 
-Kevin

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [PATCH] Addition of some trivial auto vacuum logging

2011-09-27 Thread Royce Ausburn
Thanks for the tips guys. 

Just a question:  is the utility great enough to warrant me working further on 
this?  I have no real desire to implement this particular feature -- I simply 
saw an opportunity to cut my teeth on something easy.  I'd be happy to find 
something on the TODO list instead if this feature isn't really worthwhile.

Tom's suggestion looks like it's less trivial that I can do just yet, but I'll 
take a look and ask for help if I need it.

Cheers!

--Royce


On 28/09/2011, at 4:42 AM, Kevin Grittner wrote:

 Royce Ausburn royce...@inomial.com wrote:
 
 As this is my first patch to postgresql, I'm expecting I've done
  something wrong.  Please if you want me to fix something up, or
 just go away please say so ;)  I appreciate that this is a trivial
 patch, and perhaps doesn't add value except for my very specific
 use case* feel free to ignore it =)
 
 Thanks for offering this to the community.  I see you've already
 gotten feedback on the patch, with a suggestion for a different
 approach.  Don't let that discourage you -- very few patches get in
 without needing to be modified based on review and feedback.
 
 If you haven't already done so, please review this page and its
 links:
 
 http://www.postgresql.org/developer/
 
 Of particular interest is the Developer FAQ:
 
 http://wiki.postgresql.org/wiki/Developer_FAQ
 
 You should also be aware of the development cycle, which (when not
 in feature freeze for beta testing) involves alternating periods of
 focused development and code review (the latter called CommitFests):
 
 http://wiki.postgresql.org/wiki/CommitFest
 
 We are now in the midst of a CF, so it would be great if you could
 join in that as a reviewer.  Newly submitted patches should be
 submitted to the open CF:
 
 http://commitfest.postgresql.org/action/commitfest_view/open
 
 You might want to consider what Tom said and submit a modified patch
 for the next review cycle.
 
 Welcome!
 
 -Kevin


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [PATCH] Addition of some trivial auto vacuum logging

2011-09-27 Thread Stephen Frost
* Royce Ausburn (royce...@inomial.com) wrote:
 Just a question:  is the utility great enough to warrant me working further 
 on this?  I have no real desire to implement this particular feature -- I 
 simply saw an opportunity to cut my teeth on something easy.  I'd be happy to 
 find something on the TODO list instead if this feature isn't really 
 worthwhile.

Seeing as how it's already got one committer willing to consider it (and
that one tends to go the other direction on new features..), I'd
definitely say it's worthwhile.  That doesn't mean it's guaranteed to
get in, but I'd put the probability above 75% given that feedback.
That's pretty good overall. :)

 Tom's suggestion looks like it's less trivial that I can do just yet, but 
 I'll take a look and ask for help if I need it.

Don't let the notion of fiddling with the catalogs (system tables)
discourage you..  It's really not all *that* bad.  What you will need to
figure out (and which I don't recall offhand..) is if you can just
update those catalogs directly from VACUUM or if you need to go through
the statistics collecter (which involves a bit of UDP communication, but
hopefully we've abstracted that out enough that you won't have to deal
with it directly really..).

Looking at an existing example case where VACUUM is doing something that
updates the stat tables (such as under the 'ANALYZE' option) will help
out a lot, I'm sure.

Thanks,

Stephen


signature.asc
Description: Digital signature


Re: [HACKERS] [PATCH] Addition of some trivial auto vacuum logging

2011-09-27 Thread Alvaro Herrera

Excerpts from Royce Ausburn's message of mar sep 27 21:28:26 -0300 2011:
 Thanks for the tips guys. 
 
 Just a question:  is the utility great enough to warrant me working further 
 on this?  I have no real desire to implement this particular feature -- I 
 simply saw an opportunity to cut my teeth on something easy.  I'd be happy to 
 find something on the TODO list instead if this feature isn't really 
 worthwhile.

First patches are always going to be small things.  If you try to tackle
something too large, chances are you'll never finish, despair utterly
and throw yourself off a nearby bridge.  Surely it's better to set
realistic goals, start small and build slowly from there.

 Tom's suggestion looks like it's less trivial that I can do just yet, but 
 I'll take a look and ask for help if I need it.

It's not that difficult.  Just do a search on git log
src/backend/postmaster/pgstat.c for patches that add a new column
somewhere.

-- 
Álvaro Herrera alvhe...@commandprompt.com
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] [PATCH] Addition of some trivial auto vacuum logging

2011-09-27 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes:
 Excerpts from Royce Ausburn's message of mar sep 27 21:28:26 -0300 2011:
 Tom's suggestion looks like it's less trivial that I can do just yet, but 
 I'll take a look and ask for help if I need it.

 It's not that difficult.  Just do a search on git log
 src/backend/postmaster/pgstat.c for patches that add a new column
 somewhere.

Yeah, I was just about to say the same thing.  Find a previous patch
that adds a feature similar to what you have in mind, and crib like mad.
We've added enough stats counters over time that you should have several
models to work from.

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers