Re: [PATCHES] Autovacuum docs

2005-09-13 Thread Peter Eisentraut
Tom Lane wrote:
> I think we mostly don't use endterm on cross-references to sections.
> Not sure if that's a project standard, or just laziness, though.

Yes, please don't use those.

> The other sect2 titles in this chapter capitalize only the first
> word. Again, I'm not sure how fully that convention is followed, but
> I think this would look better as "The auto-vacuum daemon".

More likely it's "The autovacuum daemon" without hyphen, which is the 
spelling the actual text uses.   But I'd personally rather see 
consistent title capitalization on all section levels.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [PATCHES] Autovacuum docs

2005-09-12 Thread Michael Paesold

Alvaro Herrera wrote:

"These settings control the default behavior for the autovacuum daemon.
Please refer to _Section 22.1.4_ for more information."

I don't see how to cleanly fit "The auto-vacuum daemon" in that sentence
in a way that looks like a reference.

So, in short, if there is a policy on this, I propose to update it to
use endterm wherever the surrounding text allows it.


IIRC the reasoning for not using endterm is that the docs should work well 
with output formats that don't have hyperlinks, e.g. print. There it is 
necessary to include the section number for easy navigation.


Best Regards,
Michael Paesold 



---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [PATCHES] Autovacuum docs

2005-09-12 Thread Alvaro Herrera
On Mon, Sep 12, 2005 at 04:17:29PM -0400, Tom Lane wrote:
> Alvaro Herrera <[EMAIL PROTECTED]> writes:
> > I have prepared some docs for autovacuum.  I attach the patch.  Comments
> > on grammar, style etc. are welcome.

Applied, updated per your comments.

> > +See .
> 
> I think we mostly don't use endterm on cross-references to sections.
> Not sure if that's a project standard, or just laziness, though.
> (Peter?)

I removed it, but personally I think it's better to put it where it
makes the text read naturally.  For example, that text reads
"See _The auto-vacuum daemon_", instead of "See _Section 21.1.4_" -- I
think the former is better.  There are instances where it doesn't read 
so good, for example in the runtime configuration chapter, the text is

"These settings control the default behavior for the autovacuum daemon.
Please refer to _Section 22.1.4_ for more information."

I don't see how to cleanly fit "The auto-vacuum daemon" in that sentence
in a way that looks like a reference.

So, in short, if there is a policy on this, I propose to update it to
use endterm wherever the surrounding text allows it.


Please check the new version.  Bruce's site is already up to date:

http://candle.pha.pa.us/main/writings/pgsql/sgml/maintenance.html#AUTOVACUUM

-- 
Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com
One man's impedance mismatch is another man's layer of abstraction.
(Lincoln Yeoh)

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [PATCHES] Autovacuum docs

2005-09-12 Thread Matthew T. O'Connor

Tom Lane wrote:


+ Additionally to the base threshold values and scale factors, there are
+ two parameters that can be set for each table in pg_autovacuum: 
   



"Additionally to" is not good style ... maybe "Besides"?
 



I think "In addition to" was what Alvaro meant, which works. 


I just gave the patch a quick eye-balling and it looks good to me.

Alvaro, thanks for doing this, I know I said I would get to it, but I 
just don't seem to be able to find time for Postgres work these days.  
If fact I can barely find enough time to keep up with the lists these 
days.  Anyway, it looks good and thanks!


Matt



---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [PATCHES] Autovacuum docs

2005-09-12 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> I have prepared some docs for autovacuum.  I attach the patch.  Comments
> on grammar, style etc. are welcome.

A few piddling suggestions:

> +See .

I think we mostly don't use endterm on cross-references to sections.
Not sure if that's a project standard, or just laziness, though.
(Peter?)

> +   
> +The Auto-Vacuum Daemon

The other sect2 titles in this chapter capitalize only the first word.
Again, I'm not sure how fully that convention is followed, but I think
this would look better as "The auto-vacuum daemon".

> + for more details on the global settings.  Note that the autovacuum
> + daemon can be instructed to skip particular tables, by setting the
> + pg_autovacuum.enabled field to 
> false.
> +

This "note" seems a bit awkwardly placed.  I'd drop it and instead add
"enabled" to the list of additional pg_autovacuum parameters here:

> + Additionally to the base threshold values and scale factors, there are
> + two parameters that can be set for each table in 
> pg_autovacuum: 

"Additionally to" is not good style ... maybe "Besides"?
  
>   
> ***
> *** 3470,3477 
>   VACUUM operations.  If -1 is specified (which is the
>   default), the regular
>value will be used.
> - This setting can be overridden for individual tables by entries in
> - pg_autovacuum.
>  
> 
>
> --- 3467,3472 
> ***
> *** 3487,3494 
>   VACUUM operations.  If -1 is specified (which is the
>   default), the regular
>value will be used.
> - This setting can be overridden for individual tables by entries in
> - pg_autovacuum.
>  
> 
>
> --- 3482,3487 

I don't think you should remove those sentences.  The information about
GUC variables is intentionally somewhat redundant with discussions
elsewhere, and in this case it's important as a cross-reference.

Otherwise looks great.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] Autovacuum docs

2005-09-12 Thread Peter Eisentraut
Alvaro Herrera wrote:
> I have prepared some docs for autovacuum.  I attach the patch. 
> Comments on grammar, style etc. are welcome.

Looks very good to me.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[PATCHES] Autovacuum docs

2005-09-12 Thread Alvaro Herrera
Hackers,

I have prepared some docs for autovacuum.  I attach the patch.  Comments
on grammar, style etc. are welcome.

I will not apply it yet because it conflicts with Neil's runtime-config
restructuring, so I'll wait until he applies his patch.

-- 
Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com
www.google.com: interfaz de lĂ­nea de comando para la web.
Index: catalogs.sgml
===
RCS file: /home/alvherre/cvs/pgsql/doc/src/sgml/catalogs.sgml,v
retrieving revision 2.113
diff -c -r2.113 catalogs.sgml
*** catalogs.sgml   8 Sep 2005 20:07:41 -   2.113
--- catalogs.sgml   12 Sep 2005 13:56:35 -
***
*** 1137,1145 
 pg_autovacuum

  

 The catalog pg_autovacuum stores optional
!per-relation configuration parameters for autovacuum.
 If there is an entry here for a particular relation, the given
 parameters will be used for autovacuuming that table.  If no entry
 is present, the system-wide defaults will be used.
--- 1137,1150 
 pg_autovacuum

  
+   
+autovacuum
+table-specific configuration
+   
+ 

 The catalog pg_autovacuum stores optional
!per-relation configuration parameters for .
 If there is an entry here for a particular relation, the given
 parameters will be used for autovacuuming that table.  If no entry
 is present, the system-wide defaults will be used.
Index: maintenance.sgml
===
RCS file: /home/alvherre/cvs/pgsql/doc/src/sgml/maintenance.sgml,v
retrieving revision 1.45
diff -c -r1.45 maintenance.sgml
*** maintenance.sgml22 Jun 2005 21:14:28 -  1.45
--- maintenance.sgml12 Sep 2005 14:10:17 -
***
*** 99,104 
--- 99,110 
 .

  
+   
+An automated mechanism for performing the necessary VACUUM
+operations has been added in PostgreSQL 8.1.
+See .
+   
+ 

 Recovering disk space
  
***
*** 177,189 
  the program vacuumdb may be helpful.
 
  
-
- 
-  The contrib/pg_autovacuum program can be useful for
-  automating high-frequency vacuuming operations.
- 
-
- 
 
  VACUUM FULL is recommended for cases where you know
  you have deleted the majority of rows in a table, so that the
--- 183,188 
***
*** 456,461 
--- 455,551 
  
 

+ 
+   
+The Auto-Vacuum Daemon
+ 
+
+ autovacuum
+ general information
+
+
+ Beginning in PostgreSQL  8.1, there is a
+ separate optional server process called the autovacuum
+ daemon, whose purpose is to automate the issuance of
+ VACUUM and ANALYZE  commands.
+ When enabled, the autovacuum daemon runs periodically and checks for
+ tables that have had a large number of inserted, updated or deleted
+ tuples.  These checks use the row-level statistics collection facility;
+ therefore, the autovacuum daemon cannot be used unless  and  are set true.  Also, 
it's
+ important to allow a slot for the autovacuum process when choosing the
+ value of .
+
+ 
+
+ The autovacuum daemon, when enabled, runs every  seconds and determines which database
+ to process.  Any database which is close to transaction ID wraparound
+ is immediately processed.  In this case, autovacuum issues a
+ database-wide VACUUM call, or VACUUM
+ FREEZE if it's a template database, and then terminates.  If
+ no database fulfills this criterion, the one that was least recently
+ processed by autovacuum itself is chosen.  In this mode, each table in
+ the database is checked for new and obsolete tuples, according to the
+ applicable autovacuum parameters.  If a 
+ pg_autovacuum tuple is found for this
+ table, these settings are applied; otherwise the global values in
+ postgresql.conf are used.  See 
+ for more details on the global settings.  Note that the autovacuum
+ daemon can be instructed to skip particular tables, by setting the
+ pg_autovacuum.enabled field to 
false.
+
+ 
+
+ For each table, two conditions are used to determine which operation to
+ apply.  If the number of obsolete tuples since the last
+ VACUUM exceeds the vacuum threshold, the
+ table is vacuumed and analyzed.  The vacuum threshold is defined as:
+ 
+ vacuum threshold = vacuum base threshold + vacuum scale factor * number of 
tuples
+ 
+ where the vacuum base threshold is
+ 
pg_autovacuum.vac_base_thresh,
+ the vacuum scale factor is
+ 
pg_autovacuum.vac_scale_factor
+ and the number of tuples is
+ pg_class.reltuples.
+ The number of obsolete tuples is taken from the statistics
+ collector, which is a semi-accurate count updated by each
+ UPDATE and DELETE operation.  (It
+ is only semi-accurate because some information may be lo