This is a discussion on log_autovacuum within the Pgsql Patches forums, part of the PostgreSQL category; --> Alvaro Herrera <alvherre@commandprompt.com> writes: > Alvaro Herrera wrote: >> Tom Lane wrote: >>> BTW, shouldn't the log entry distinguish ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Alvaro Herrera <alvherre@commandprompt.com> writes: > Alvaro Herrera wrote: >> Tom Lane wrote: >>> BTW, shouldn't the log entry distinguish whether this was VACUUM, >>> ANALYZE, or both? >> >> We don't actually log anything for ANALYZE (the logging code is in >> lazy_vacuum_rel). >> >> Maybe it should be in autovacuum.c. Actually, I had misunderstood where you were proposing to put this. I believe that where you have it, the elapsed-time indication will only cover the VACUUM step; so it's not relevant to this code whether an ANALYZE would happen too. My suggestion is that you add similar but independent logging to analyze.c, controlled by the same min-duration variable. So the log output would treat autovac and autoanalyze as two independently loggable operations. I don't think there's much to print about an autoanalyze except its runtime ... well, maybe you could print the numbers of rows sampled and estimated, but I dunno if it matters. The point of doing it is just to be able to track what the heck autovacuum is doing ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| |||
| Tom Lane wrote: > Alvaro Herrera <alvherre@commandprompt.com> writes: > > Alvaro Herrera wrote: > >> Tom Lane wrote: > >>> BTW, shouldn't the log entry distinguish whether this was VACUUM, > >>> ANALYZE, or both? > >> > >> We don't actually log anything for ANALYZE (the logging code is in > >> lazy_vacuum_rel). > >> > >> Maybe it should be in autovacuum.c. > > Actually, I had misunderstood where you were proposing to put this. > I believe that where you have it, the elapsed-time indication will > only cover the VACUUM step; so it's not relevant to this code whether > an ANALYZE would happen too. Correct. > My suggestion is that you add similar but independent logging to > analyze.c, controlled by the same min-duration variable. So the > log output would treat autovac and autoanalyze as two independently > loggable operations. I don't think there's much to print about > an autoanalyze except its runtime ... well, maybe you could print > the numbers of rows sampled and estimated, but I dunno if it matters. > The point of doing it is just to be able to track what the heck > autovacuum is doing ... Seems fair. Updated patch attached. If there are no further comments, I'll add some docs and apply it later. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| Alvaro Herrera wrote: > Seems fair. Updated patch attached. > > If there are no further comments, I'll add some docs and apply it later. If autovacuum_vacuum_cost_delay is set to 20, my pitiful desktop system takes 8.4 seconds to analyze a 8000 page table: DEBUG: "bar": scanned 3000 of 8811 pages, containing 681000 live rows and 0 dead rows; 3000 rows in sample, 2000097 estimated total rows LOG: automatic analyze of table "alvherre.public.bar" system usage: CPU 0.00s/0.01u sec elapsed 8.39 sec So I guess logging on ANALYZE is not that removed from reality. I also think we should remove these DEBUG messages, that are now useless: DEBUG: autovac: will ANALYZE bar -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| |||
| Alvaro Herrera <alvherre@commandprompt.com> writes: > I also think we should remove these DEBUG messages, that are now > useless: > DEBUG: autovac: will ANALYZE bar +1, those were just ad-hoc. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| On Tue, 2007-04-17 at 21:45 -0400, Alvaro Herrera wrote: > Alvaro Herrera wrote: > > > Seems fair. Updated patch attached. > > > > If there are no further comments, I'll add some docs and apply it later. > > If autovacuum_vacuum_cost_delay is set to 20, my pitiful desktop system > takes 8.4 seconds to analyze a 8000 page table: > > DEBUG: "bar": scanned 3000 of 8811 pages, containing 681000 live rows and 0 dead rows; 3000 rows in sample, 2000097 estimated total rows > LOG: automatic analyze of table "alvherre.public.bar" system usage: CPU 0.00s/0.01u sec elapsed 8.39 sec > > So I guess logging on ANALYZE is not that removed from reality. > > I also think we should remove these DEBUG messages, that are now > useless: > > DEBUG: autovac: will ANALYZE bar Looks good. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| ||||
| I applied this patch some hours ago but I haven't gotten the pgsql-committers mail and I don't see it in the archives either. Here is the evidence: http://developer.postgresql.org/cvsw...ml/config.sgml Is there a problem with pgsql-committers again? Attached is the patch I applied. $ cvs commit -F msg ? msg ? cscope.out ? cscope.files Checking in doc/src/sgml/config.sgml; /cvsroot/pgsql/doc/src/sgml/config.sgml,v <-- config.sgml new revision: 1.121; previous revision: 1.120 done Checking in src/backend/commands/analyze.c; /cvsroot/pgsql/src/backend/commands/analyze.c,v <-- analyze.c new revision: 1.105; previous revision: 1.104 done Checking in src/backend/commands/vacuumlazy.c; /cvsroot/pgsql/src/backend/commands/vacuumlazy.c,v <-- vacuumlazy.c new revision: 1.86; previous revision: 1.85 done Checking in src/backend/postmaster/autovacuum.c; /cvsroot/pgsql/src/backend/postmaster/autovacuum.c,v <-- autovacuum.c new revision: 1.42; previous revision: 1.41 done Checking in src/backend/utils/misc/guc.c; /cvsroot/pgsql/src/backend/utils/misc/guc.c,v <-- guc.c new revision: 1.386; previous revision: 1.385 done Checking in src/backend/utils/misc/postgresql.conf.sample; /cvsroot/pgsql/src/backend/utils/misc/postgresql.conf.sample,v <-- postgresql.conf.sample new revision: 1.215; previous revision: 1.214 done Checking in src/include/postmaster/autovacuum.h; /cvsroot/pgsql/src/include/postmaster/autovacuum.h,v <-- autovacuum.h new revision: 1.10; previous revision: 1.9 done Collecting file lists...Done. Sending mail to pgsql-committers@postgresql.org...Done -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| Thread Tools | |
| Display Modes | |
|
|