Commit Graph

172 Commits

Author SHA1 Message Date
Alvaro Herrera 801c2dc72c Separate multixact freezing parameters from xid's
Previously we were piggybacking on transaction ID parameters to freeze
multixacts; but since there isn't necessarily any relationship between
rates of Xid and multixact consumption, this turns out not to be a good
idea.

Therefore, we now have multixact-specific freezing parameters:

vacuum_multixact_freeze_min_age: when to remove multis as we come across
them in vacuum (default to 5 million, i.e. early in comparison to Xid's
default of 50 million)

vacuum_multixact_freeze_table_age: when to force whole-table scans
instead of scanning only the pages marked as not all visible in
visibility map (default to 150 million, same as for Xids).  Whichever of
both which reaches the 150 million mark earlier will cause a whole-table
scan.

autovacuum_multixact_freeze_max_age: when for cause emergency,
uninterruptible whole-table scans (default to 400 million, double as
that for Xids).  This means there shouldn't be more frequent emergency
vacuuming than previously, unless multixacts are being used very
rapidly.

Backpatch to 9.3 where multixacts were made to persist enough to require
freezing.  To avoid an ABI break in 9.3, VacuumStmt has a couple of
fields in an unnatural place, and StdRdOptions is split in two so that
the newly added fields can go at the end.

Patch by me, reviewed by Robert Haas, with additional input from Andres
Freund and Tom Lane.
2014-02-13 19:36:31 -03:00
Bruce Momjian b1cbd2b573 docs: add mention of index swapping
Backpatch to 9.3

Greg Smith
2014-01-30 12:14:24 -05:00
Robert Haas d43760b624 Revise documentation for new freezing method.
Commit 37484ad2aa invalidated a good
chunk of documentation, so patch it up to reflect the new state of
play.  Along the way, patch remaining documentation references to
FrozenXID to say instead FrozenTransactionId, so that they match the
way we actually spell it in the code.
2013-12-23 20:36:31 -05:00
Tom Lane ccca6f56f5 Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31.
Pointed out by Gianni Ciolli.
2013-12-12 12:39:48 -05:00
Andrew Dunstan f002dc3d4d Fix relfrozenxid query in docs to include TOAST tables.
The original query ignored TOAST tables which could result in tables
needing a vacuum not being reported.

Backpatch to all live branches.
2013-09-02 14:38:12 -04:00
Peter Eisentraut f02b14f787 doc: Replace link to pgFouine with pgBadger
From: Ian Lawrence Barwick <barwick@gmail.com>
2013-07-10 22:40:41 -04:00
Noah Misch 02d2b694ee Update messages, comments and documentation for materialized views.
All instances of the verbiage lagging the code.  Back-patch to 9.3,
where materialized views were introduced.
2013-07-05 15:37:51 -04:00
Peter Eisentraut 7dfd5cd21c Clarify terminology standalone backend vs. single-user mode
Most of the documentation uses "single-user mode", so use that in the
code as well.  Adjust the documentation to match the new error message
wording.  Also add a documentation index entry for "single-user mode".

Based-on-patch-by: Jeff Janes <jeff.janes@gmail.com>
2013-06-20 23:03:18 -04:00
Peter Eisentraut 8b5a3998a1 Remove whitespace from end of lines 2013-05-30 21:05:07 -04:00
Kevin Grittner 327542645e Fix documentation reference to maximum allowed for autovacuum_freeze_max_age.
The documentation mentioned setting autovacuum_freeze_max_age to
"its maximum allowed value of a little less than two billion".
This led to a post asking about the exact maximum allowed value,
which is precisely two billion, not "a little less".

Based on question by Radovan Jablonovsky.  Backpatch to 8.3.
2012-09-16 11:59:50 -05:00
Bruce Momjian 83fbfec383 Document that log_autovacuum_min_duration can be used to monitor
autovacuum activity.

Per report from Marc Mamin
2012-08-30 14:44:46 -04:00
Peter Eisentraut 5baf6da717 Documentation spell and markup checking 2012-06-08 00:06:20 +03:00
Tom Lane 263d9de66b Allow statistics to be collected for foreign tables.
ANALYZE now accepts foreign tables and allows the table's FDW to control
how the sample rows are collected.  (But only manual ANALYZEs will touch
foreign tables, for the moment, since among other things it's not very
clear how to handle remote permissions checks in an auto-analyze.)

contrib/file_fdw is extended to support this.

Etsuro Fujita, reviewed by Shigeru Hanada, some further tweaking by me.
2012-04-06 15:02:35 -04:00
Robert Haas 5b9c1e6d52 Doc updates for index-only scans.
Document that routine vacuuming is now also important for the purpose
of index-only scans; and mention in the section that describes the
visibility map that it is used to implement index-only scans.

Marti Raudsepp, with some changes by me.
2012-03-21 14:52:44 -04:00
Bruce Momjian 03c25dd900 Mark all GUC variables with <varname> markup, rather than <literal>. 2011-02-02 18:06:38 -05:00
Tom Lane 2cdf6c1551 Fix a missed explanation of auto-analyze threshold, per Joe Miller. 2010-09-21 16:40:41 -04:00
Magnus Hagander 9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Bruce Momjian f495020ede Fix SGML markup 2010-05-26 23:55:51 +00:00
Bruce Momjian 092c38a2a8 Document pgFouine and check_postgres as log analysis options. 2010-05-26 23:29:45 +00:00
Bruce Momjian b4fd1e246e Document that autovacuum cannot vacuum or analyze temporary tables. 2010-04-16 02:22:33 +00:00
Peter Eisentraut 6dcce3985b Remove unnecessary xref endterm attributes and title ids
The endterm attribute is mainly useful when the toolchain does not support
automatic link target text generation for a particular situation.  In  the
past, this was required by the man page tools for all reference page links,
but that is no longer the case, and it now actually gets in the way of
proper automatic link text generation.  The only remaining use cases are
currently xrefs to refsects.
2010-04-03 07:23:02 +00:00
Peter Eisentraut a95e51962d Update broken and permanently moved links 2010-03-17 17:12:31 +00:00
Bruce Momjian 1379fb052f Document that expression indexes that call functions allow function-level
statistics.
2010-02-23 02:47:27 +00:00
Tom Lane 0a469c8769 Remove old-style VACUUM FULL (which was known for a little while as
VACUUM FULL INPLACE), along with a boatload of subsidiary code and complexity.
Per discussion, the use case for this method of vacuuming is no longer large
enough to justify maintaining it; not to mention that we don't wish to invest
the work that would be needed to make it play nicely with Hot Standby.

Aside from the code directly related to old-style VACUUM FULL, this commit
removes support for certain WAL record types that could only be generated
within VACUUM FULL, redirect-pointer removal in heap_page_prune, and
nontransactional generation of cache invalidation sinval messages (the last
being the sticking point for Hot Standby).

We still have to retain all code that copes with finding HEAP_MOVED_OFF and
HEAP_MOVED_IN flag bits on existing tuples.  This can't be removed as long
as we want to support in-place update from pre-9.0 databases.
2010-02-08 04:33:55 +00:00
Bruce Momjian bf62b1a078 Proofreading improvements for the Administration documentation book. 2010-02-03 17:25:06 +00:00
Tom Lane 5e66a51c2e Provide a parenthesized-options syntax for VACUUM, analogous to that recently
adopted for EXPLAIN.  This will allow additional options to be implemented
in future without having to make them fully-reserved keywords.  The old syntax
remains available for existing options, however.

Itagaki Takahiro
2009-11-16 21:32:07 +00:00
Alvaro Herrera 05f43650fc Document that autovacuum may run ANALYZE 2009-08-07 20:54:31 +00:00
Peter Eisentraut 5126826c52 Add another link of a GUC variable to where it is explained. 2009-06-17 13:59:28 +00:00
Tom Lane 606f5d1763 Minor copy-editing for description of partial-table vacuuming. 2009-05-16 22:51:24 +00:00
Heikki Linnakangas 335904b4f8 Improve the documentation on 8.4 visibility map related VACUUM changes.
Explain how vacuum_freeze_table_age should be tuned, and how it relates
to the other settings. Mention that vacuum_freeze_table_age also affects
when autovacuum scans the whole table.
2009-04-23 10:09:11 +00:00
Bruce Momjian e019178c77 Doc change in new patch, stand-alone -> standalone 2009-04-06 17:56:31 +00:00
Bruce Momjian d9070485a8 Add documentation mention of 'check_postgres.pl' in Routine Database
Maintenance Tasks section.
2009-04-06 17:55:19 +00:00
Alvaro Herrera 834a6da4f7 Update autovacuum to use reloptions instead of a system catalog, for
per-table overrides of parameters.

This removes a whole class of problems related to misusing the catalog,
and perhaps more importantly, gives us pg_dump support for the parameters.

Based on a patch by Euler Taveira de Oliveira, heavily reworked by me.
2009-02-09 20:57:59 +00:00
Heikki Linnakangas 6587818542 Add vacuum_freeze_table_age GUC option, to control when VACUUM should
ignore the visibility map and scan the whole table, to advance
relfrozenxid.
2009-01-16 13:27:24 +00:00
Tom Lane 17dc173660 To reduce confusion over whether VACUUM FULL is needed for anti-wraparound
vacuuming (it's not), say "database-wide VACUUM" instead of "full-database
VACUUM" in the relevant hint messages.  Also, document the permissions needed
to do this.  Per today's discussion.
2008-12-11 18:16:18 +00:00
Magnus Hagander 9edd720050 Clearify how processes are started by autovacuum, and what the effect
of autovacuum_max_workers parameter is.

Per discussion with Alvaro.
2008-12-08 20:30:58 +00:00
Tom Lane 9dac1b460f Rewrite docs section about routine vacuuming --- it's gotten rather mangled of
late, with lots of redundancy, bad grammar, and just plain poor exposition.
Make it clear that autovacuum is now considered the normal solution.
2008-06-16 03:13:14 +00:00
Peter Eisentraut 9293425819 spell checker run 2007-11-28 15:42:31 +00:00
Alvaro Herrera 2a997a7065 A few improvements to analyze and vacuum sections in documentation: add "see
also" entries for autovacuum in analyze and vacuum reference pages, and
enhance usage of cross-references in the maintenance page.
2007-10-07 01:16:42 +00:00
Alvaro Herrera f5e2911144 Fix missing parenthesis, per Guillaume Lelarge. 2007-10-06 17:45:49 +00:00
Tom Lane 48f7e64395 Simplify and rename some GUC variables, per various recent discussions:
* stats_start_collector goes away; we always start the collector process,
unless prevented by a problem with setting up the stats UDP socket.

* stats_reset_on_server_start goes away; it seems useless in view of the
availability of pg_stat_reset().

* stats_block_level and stats_row_level are merged into a single variable
"track_counts", which controls all reports sent to the collector process.

* stats_command_string is renamed to track_activities.

* log_autovacuum is renamed to log_autovacuum_min_duration to better reflect
its meaning.

The log_autovacuum change is not a compatibility issue since it didn't exist
before 8.3 anyway.  The other changes need to be release-noted.
2007-09-24 03:12:23 +00:00
Bruce Momjian 13e26073bd Update documentation to mention that autovacuum also does analyze so we
don't need to recommend nightly analyzes anymore unless autovacuum is off.
2007-09-14 13:43:03 +00:00
Bruce Momjian aa33bdd783 Update documented error text.
Fujii Masao
2007-09-14 02:43:18 +00:00
Bruce Momjian f307fe4c9b Update documentation to emphasize autovacuum rather than
administrator-scheduled vacuums.
2007-09-13 23:43:35 +00:00
Andrew Dunstan fd801f4faa Provide for logfiles in machine readable CSV format. In consequence, rename
redirect_stderr to logging_collector.
Original patch from Arul Shaji, subsequently modified by Greg Smith, and then
heavily modified by me.
2007-08-19 01:41:25 +00:00
Alvaro Herrera aa81c558ee Reword paragraph about the autovacuum_max_workers setting. Patch from
Jim Nasby.
2007-07-23 17:22:00 +00:00
Bruce Momjian 9e19063abc Document that 'deleted' is also tracked by autovacuum. 2007-07-18 03:39:01 +00:00
Bruce Momjian 9e38d2a4a8 Update documentation mention of VACUUM FULL and CLUSTER where
appropriate.

Guillaume Cottenceau
2007-05-30 19:45:01 +00:00
Neil Conway 39712d1184 Make a few marginal improvements to the documentation for the AV
launcher daemon.
2007-05-15 15:52:40 +00:00
Alvaro Herrera 1aefa0489f Fix a few more double words in docs. 2007-05-03 15:47:48 +00:00
Bruce Momjian 05cd021c30 Remove tabs from SGML source files. 2007-04-18 20:44:53 +00:00
Alvaro Herrera e2a186b03c Add a multi-worker capability to autovacuum. This allows multiple worker
processes to be running simultaneously.  Also, now autovacuum processes do not
count towards the max_connections limit; they are counted separately from
regular processes, and are limited by the new GUC variable
autovacuum_max_workers.

The launcher now has intelligence to launch workers on each database every
autovacuum_naptime seconds, limited only on the max amount of worker slots
available.

Also, the global worker I/O utilization is limited by the vacuum cost-based
delay feature.  Workers are "balanced" so that the total I/O consumption does
not exceed the established limit.  This part of the patch was contributed by
ITAGAKI Takahiro.

Per discussion.
2007-04-16 18:30:04 +00:00
Bruce Momjian 8b4ff8b6a1 Wording cleanup for error messages. Also change can't -> cannot.
Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".
2007-02-01 19:10:30 +00:00
Bruce Momjian 09a9f10e7f Consistenly use colons before '<programlisting>' blocks, where
appropriate.
2007-02-01 00:28:19 +00:00
Bruce Momjian a134ee3379 Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".

Also update two error messages mentioned in the documenation to match.
2007-01-31 20:56:20 +00:00
Bruce Momjian 0867493510 Document need for periodic REINDEX in VACUUM FULL cases. 2007-01-31 04:13:22 +00:00
Alvaro Herrera 10a5e3348e Enable autovacuum in the default configuration, per discussion. 2007-01-16 18:26:02 +00:00
Bruce Momjian 4f1e49119e Use "dead" rather than "expired" for vacuumable rows. 2006-12-27 14:55:17 +00:00
Tom Lane 48188e1621 Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios.  We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases.  Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId.  Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done.  Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database.  initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs.  Heikki Linnakangas, Simon Riggs, and Tom Lane.
2006-11-05 22:42:10 +00:00
Peter Eisentraut 0f763503ff Spellchecking and such 2006-10-23 18:10:32 +00:00
Bruce Momjian 32cebaecff Remove emacs info from footer of SGML files. 2006-09-16 00:30:20 +00:00
Peter Eisentraut ba9f9bf1b1 Revert change to turn autovacuum on by default. 2006-08-29 11:37:47 +00:00
Peter Eisentraut 88b8110443 Turn autovacuum on by default. (stats_row_level is also on by default.)
Threshold and scale factor are cut in half for more aggressive behavior.
2006-08-28 13:37:18 +00:00
Bruce Momjian a83437fcfd Slight wording improvement in documentation. 2006-08-04 04:07:38 +00:00
Alvaro Herrera 5f69890e15 Editorialize a bit on the recent patch, reverting to the original versions
of the text where appropiate.
2006-08-01 19:17:18 +00:00
Bruce Momjian 8d5f3c8d89 Improvements to Maintenance and External Projects documentation.
Joshua D. Drake
Robert Treat
2006-08-01 00:09:06 +00:00
Peter Eisentraut 5266f221a2 Merge postmaster and postgres command into just postgres. postmaster
symlink is kept for now for compatibility.  To call single-user mode, use
postgres --single.
2006-06-18 15:38:37 +00:00
Bruce Momjian efe3de07e9 Removes or minimizes some documentation mentions of backward
compatibility for release 7.2 and earlier.  I have not altered any
mentions of release 7.3 or later.  The release notes were not modified,
so the changes are still documented, just not in the main docs.
2006-04-23 03:39:52 +00:00
Bruce Momjian 497b5ad928 Make $PostgreSQL CVS tags consistent for SGML files. 2006-03-10 19:10:50 +00:00
Bruce Momjian 823702be9d Improve lazy vacuum wording. 2005-12-07 14:35:45 +00:00
Bruce Momjian 95aca45010 Clarify vacuum lazy can shrink a file under certain circumstances. 2005-12-07 05:35:53 +00:00
Peter Eisentraut 39dfbe5791 Spellchecking run, final cleanups 2005-11-04 23:14:02 +00:00
Tom Lane b524cb36ac Make an editorial pass over the reference pages. 2005-11-01 21:09:51 +00:00
Tom Lane fdff883aca Clean up autovacuum documentation, which was a bit out of sync with what
the code actually does, and needed copy-editing anyway.  Also take the
opportunity to expand the section on routine reindexing.
2005-10-21 19:39:08 +00:00
Bruce Momjian 18ea8ae531 Attached patch takes a swing at improving the autovacuum wording in
maintenance.sgml.

Robert Treat

[ Also fix create domain markup.]
2005-09-23 02:01:35 +00:00
Alvaro Herrera 3e579cf3c0 Add note about pg_autovacuum settings not being saved on a dump, per
Robert Treat.
2005-09-16 03:12:32 +00:00
Alvaro Herrera c93912b711 Document the new autovacuum daemon. 2005-09-13 01:51:18 +00:00
Tom Lane 4cc7a93d22 Make REINDEX DATABASE do what one would expect, namely reindex all indexes
in the database.  The old behavior (reindex system catalogs only) is now
available as REINDEX SYSTEM.  I did not add the complementary REINDEX USER
case since there did not seem to be consensus for this, but it would be
trivial to add later.  Per recent discussions.
2005-06-22 21:14:31 +00:00
Neil Conway 8c05ca7754 SGML cleanup: consistently use "endterm" in <xref>s that link to the
reference page for SQL commands, so that the link text is italicized.
2005-06-13 02:40:08 +00:00
Bruce Momjian 35e1651508 Back out check for unreferenced files.
Heikki Linnakangas
2005-05-10 22:27:30 +00:00
Bruce Momjian 76668e6eb4 Check the file system on postmaster startup and report any unreferenced
files in the server log.

Heikki Linnakangas
2005-05-02 18:26:54 +00:00
Tom Lane 60b2444cc3 Add code to prevent transaction ID wraparound by enforcing a safe limit
in GetNewTransactionId().  Since the limit value has to be computed
before we run any real transactions, this requires adding code to database
startup to scan pg_database and determine the oldest datfrozenxid.
This can conveniently be combined with the first stage of an attack on
the problem that the 'flat file' copies of pg_shadow and pg_group are
not properly updated during WAL recovery.  The code I've added to
startup resides in a new file src/backend/utils/init/flatfiles.c, and
it is responsible for rewriting the flat files as well as initializing
the XID wraparound limit value.  This will eventually allow us to get
rid of GetRawDatabaseInfo too, but we'll need an initdb so we can add
a trigger to pg_database.
2005-02-20 02:22:07 +00:00
Tom Lane 008e9e452f More minor updates and copy-editing. 2004-12-27 22:30:10 +00:00
Peter Eisentraut 5ec30faee6 Spell checker run 2004-12-13 18:05:10 +00:00
Neil Conway ec7a6bd9a2 Replace "--" and "---" with "&mdash;" as appropriate, for better-looking
output.
2004-11-15 06:32:15 +00:00
Tom Lane bdf8ef6925 Create a built-in log rotation program, so that we no longer have to
recommend that people go get Apache's rotatelogs program.  Additional
benefits are that configuration is done through GUC, rather than
externally, and that the postmaster can monitor the log rotator and
restart it after failure (though we certainly hope that won't happen
often).
Andreas Pflug, some rework by Tom Lane.
2004-08-05 23:32:13 +00:00
Tom Lane 0655b26282 log_destination should only be PGC_SIGHUP, not PGC_POSTMASTER, as per
discussion yesterday.  Also a few improvements in the associated
documentation.
2004-07-24 19:51:23 +00:00
Bruce Momjian 335cf9ae7f Restore one mention of logrotate, per Peter. 2004-05-16 19:34:46 +00:00
Bruce Momjian 19a495caaa Properly document rotatelogs, and add mention of it to pg_ctl manual page. 2004-05-14 20:01:19 +00:00
Bruce Momjian 6165bbab8c Remove 'syslog' GUC variable, and add more logical 'log_destination'
variable to control logoutput location on Unix and Win32.

Magnus Hagander
2004-04-05 03:02:11 +00:00
Bruce Momjian 98bb1d2085 Fix typo. 2004-03-15 14:21:30 +00:00
Bruce Momjian 10afaf472a Mention Linux syslog will sync lines to disk, and describe how to
disable it.
2004-03-15 14:15:45 +00:00
Neil Conway 0b52062265 This patch makes some improvements and adds some additional detail
to the documentation on routine database maintainence activities.
I also corrected a bunch of SGML markup.
2003-12-14 00:10:32 +00:00
PostgreSQL Daemon 969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
Peter Eisentraut 1d27de4cf4 Random copy-editing. 2003-11-04 09:55:39 +00:00
Peter Eisentraut 8442a92e5a Spell checking, consistent terminology. 2003-11-01 01:56:29 +00:00
Bruce Momjian c7c7861d5e Add mention of logrotate for syslog, from Robert Treat 2003-10-09 19:05:09 +00:00
Tom Lane 6e59122490 Update obsolete examples of error messages; various other minor editing. 2003-09-12 22:17:24 +00:00
Peter Eisentraut c326d8f4f2 Add/edit index entries. 2003-08-31 17:32:24 +00:00
Peter Eisentraut f374a9dae9 Change clusterdb and vacuumdb into C programs. 2003-06-18 12:19:11 +00:00