postgresql/src/backend
Alvaro Herrera d4cef0aa2a Improve vacuum code to track minimum Xids per table instead of per database.
To this end, add a couple of columns to pg_class, relminxid and relvacuumxid,
based on which we calculate the pg_database columns after each vacuum.

We now force all databases to be vacuumed, even template ones.  A backend
noticing too old a database (meaning pg_database.datminxid is in danger of
falling behind Xid wraparound) will signal the postmaster, which in turn will
start an autovacuum iteration to process the offending database.  In principle
this is only there to cope with frozen (non-connectable) databases without
forcing users to set them to connectable, but it could force regular user
database to go through a database-wide vacuum at any time.  Maybe we should
warn users about this somehow.  Of course the real solution will be to use
autovacuum all the time ;-)

There are some additional improvements we could have in this area: for example
the vacuum code could be smarter about not updating pg_database for each table
when called by autovacuum, and do it only once the whole autovacuum iteration
is done.

I updated the system catalogs documentation, but I didn't modify the
maintenance section.  Also having some regression tests for this would be nice
but it's not really a very straightforward thing to do.

Catalog version bumped due to system catalog changes.
2006-07-10 16:20:52 +00:00
..
access Improve vacuum code to track minimum Xids per table instead of per database. 2006-07-10 16:20:52 +00:00
bootstrap Code review for FILLFACTOR patch. Change WITH grammar as per earlier 2006-07-03 22:45:41 +00:00
catalog Improve vacuum code to track minimum Xids per table instead of per database. 2006-07-10 16:20:52 +00:00
commands Improve vacuum code to track minimum Xids per table instead of per database. 2006-07-10 16:20:52 +00:00
executor Code review for FILLFACTOR patch. Change WITH grammar as per earlier 2006-07-03 22:45:41 +00:00
lib Update copyright for 2006. Update scripts. 2006-03-05 15:59:11 +00:00
libpq Improve vacuum code to track minimum Xids per table instead of per database. 2006-07-10 16:20:52 +00:00
main Merge postmaster and postgres command into just postgres. postmaster 2006-06-18 15:38:37 +00:00
nodes Code review for FILLFACTOR patch. Change WITH grammar as per earlier 2006-07-03 22:45:41 +00:00
optimizer Fix oversight in planning for multiple indexscans driven by 2006-07-01 22:07:23 +00:00
parser Code review for FILLFACTOR patch. Change WITH grammar as per earlier 2006-07-03 22:45:41 +00:00
po Fix copy-and-pasteo in Russian translation: message complaining about 2006-06-03 16:48:59 +00:00
port Remove Win32 file, moved to /port. 2006-06-08 15:15:13 +00:00
postmaster Improve vacuum code to track minimum Xids per table instead of per database. 2006-07-10 16:20:52 +00:00
regex Re-run pgindent, fixing a problem where comment lines after a blank 2005-11-22 18:17:34 +00:00
rewrite DROP ... IF EXISTS for the following cases: 2006-06-16 20:23:45 +00:00
storage Add GUC update_process_title to control whether 'ps' display is updated 2006-06-27 22:16:44 +00:00
tcop Add FILLFACTOR to CREATE INDEX. 2006-07-02 02:23:23 +00:00
utils Improve vacuum code to track minimum Xids per table instead of per database. 2006-07-10 16:20:52 +00:00
Makefile Remove dllinit.c; it was only needed for long-obsolete Cygwin versions, 2006-06-22 23:50:35 +00:00
nls.mk Add _ to gettext triggers. Must have been forgotten here when it was introduced. 2005-10-04 11:14:03 +00:00