Header And Logo

PostgreSQL
| The world's most advanced open source database.

autovacuum.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * autovacuum.h
00004  *    header file for integrated autovacuum daemon
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/postmaster/autovacuum.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef AUTOVACUUM_H
00015 #define AUTOVACUUM_H
00016 
00017 
00018 /* GUC variables */
00019 extern bool autovacuum_start_daemon;
00020 extern int  autovacuum_max_workers;
00021 extern int  autovacuum_naptime;
00022 extern int  autovacuum_vac_thresh;
00023 extern double autovacuum_vac_scale;
00024 extern int  autovacuum_anl_thresh;
00025 extern double autovacuum_anl_scale;
00026 extern int  autovacuum_freeze_max_age;
00027 extern int  autovacuum_vac_cost_delay;
00028 extern int  autovacuum_vac_cost_limit;
00029 
00030 /* autovacuum launcher PID, only valid when worker is shutting down */
00031 extern int  AutovacuumLauncherPid;
00032 
00033 extern int  Log_autovacuum_min_duration;
00034 
00035 /* Status inquiry functions */
00036 extern bool AutoVacuumingActive(void);
00037 extern bool IsAutoVacuumLauncherProcess(void);
00038 extern bool IsAutoVacuumWorkerProcess(void);
00039 
00040 #define IsAnyAutoVacuumProcess() \
00041     (IsAutoVacuumLauncherProcess() || IsAutoVacuumWorkerProcess())
00042 
00043 /* Functions to start autovacuum process, called from postmaster */
00044 extern void autovac_init(void);
00045 extern int  StartAutoVacLauncher(void);
00046 extern int  StartAutoVacWorker(void);
00047 
00048 /* called from postmaster when a worker could not be forked */
00049 extern void AutoVacWorkerFailed(void);
00050 
00051 /* autovacuum cost-delay balancer */
00052 extern void AutoVacuumUpdateDelay(void);
00053 
00054 #ifdef EXEC_BACKEND
00055 extern void AutoVacLauncherMain(int argc, char *argv[]) __attribute__((noreturn));
00056 extern void AutoVacWorkerMain(int argc, char *argv[]) __attribute__((noreturn));
00057 extern void AutovacuumWorkerIAm(void);
00058 extern void AutovacuumLauncherIAm(void);
00059 #endif
00060 
00061 /* shared memory stuff */
00062 extern Size AutoVacuumShmemSize(void);
00063 extern void AutoVacuumShmemInit(void);
00064 
00065 #endif   /* AUTOVACUUM_H */