2005-07-14 07:13:45 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* autovacuum.h
|
|
|
|
* header file for integrated autovacuum daemon
|
|
|
|
*
|
|
|
|
*
|
2010-01-02 17:58:17 +01:00
|
|
|
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
2005-07-14 07:13:45 +02:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2010-02-26 03:01:40 +01:00
|
|
|
* $PostgreSQL: pgsql/src/include/postmaster/autovacuum.h,v 1.18 2010/02/26 02:01:27 momjian Exp $
|
2005-07-14 07:13:45 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef AUTOVACUUM_H
|
|
|
|
#define AUTOVACUUM_H
|
|
|
|
|
2007-04-16 20:30:04 +02:00
|
|
|
#include "storage/lock.h"
|
|
|
|
|
2005-07-14 07:13:45 +02:00
|
|
|
/* GUC variables */
|
2005-10-15 04:49:52 +02:00
|
|
|
extern bool autovacuum_start_daemon;
|
2007-04-16 20:30:04 +02:00
|
|
|
extern int autovacuum_max_workers;
|
2005-10-15 04:49:52 +02:00
|
|
|
extern int autovacuum_naptime;
|
|
|
|
extern int autovacuum_vac_thresh;
|
|
|
|
extern double autovacuum_vac_scale;
|
|
|
|
extern int autovacuum_anl_thresh;
|
|
|
|
extern double autovacuum_anl_scale;
|
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 23:42:10 +01:00
|
|
|
extern int autovacuum_freeze_max_age;
|
2005-10-15 04:49:52 +02:00
|
|
|
extern int autovacuum_vac_cost_delay;
|
|
|
|
extern int autovacuum_vac_cost_limit;
|
2005-07-14 07:13:45 +02:00
|
|
|
|
2007-04-16 20:30:04 +02:00
|
|
|
/* autovacuum launcher PID, only valid when worker is shutting down */
|
|
|
|
extern int AutovacuumLauncherPid;
|
|
|
|
|
2007-09-24 05:12:23 +02:00
|
|
|
extern int Log_autovacuum_min_duration;
|
2007-04-18 18:44:18 +02:00
|
|
|
|
2005-07-14 07:13:45 +02:00
|
|
|
/* Status inquiry functions */
|
|
|
|
extern bool AutoVacuumingActive(void);
|
2007-02-16 00:23:23 +01:00
|
|
|
extern bool IsAutoVacuumLauncherProcess(void);
|
|
|
|
extern bool IsAutoVacuumWorkerProcess(void);
|
2010-02-26 03:01:40 +01:00
|
|
|
|
2009-08-31 21:41:00 +02:00
|
|
|
#define IsAnyAutoVacuumProcess() \
|
|
|
|
(IsAutoVacuumLauncherProcess() || IsAutoVacuumWorkerProcess())
|
2005-07-14 07:13:45 +02:00
|
|
|
|
|
|
|
/* Functions to start autovacuum process, called from postmaster */
|
|
|
|
extern void autovac_init(void);
|
2007-02-16 00:23:23 +01:00
|
|
|
extern int StartAutoVacLauncher(void);
|
|
|
|
extern int StartAutoVacWorker(void);
|
2007-11-15 22:14:46 +01:00
|
|
|
|
2007-06-25 18:09:03 +02:00
|
|
|
/* called from postmaster when a worker could not be forked */
|
|
|
|
extern void AutoVacWorkerFailed(void);
|
2005-07-14 07:13:45 +02:00
|
|
|
|
2007-04-16 20:30:04 +02:00
|
|
|
/* autovacuum cost-delay balancer */
|
|
|
|
extern void AutoVacuumUpdateDelay(void);
|
|
|
|
|
2005-07-14 07:13:45 +02:00
|
|
|
#ifdef EXEC_BACKEND
|
2007-02-16 00:23:23 +01:00
|
|
|
extern void AutoVacLauncherMain(int argc, char *argv[]);
|
|
|
|
extern void AutoVacWorkerMain(int argc, char *argv[]);
|
|
|
|
extern void AutovacuumWorkerIAm(void);
|
|
|
|
extern void AutovacuumLauncherIAm(void);
|
2005-07-14 07:13:45 +02:00
|
|
|
#endif
|
|
|
|
|
2007-02-16 00:23:23 +01:00
|
|
|
/* shared memory stuff */
|
|
|
|
extern Size AutoVacuumShmemSize(void);
|
|
|
|
extern void AutoVacuumShmemInit(void);
|
|
|
|
|
2005-10-15 04:49:52 +02:00
|
|
|
#endif /* AUTOVACUUM_H */
|