PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
autovacuum.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * autovacuum.h
4  * header file for integrated autovacuum daemon
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/postmaster/autovacuum.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef AUTOVACUUM_H
15 #define AUTOVACUUM_H
16 
17 
18 /* GUC variables */
19 extern bool autovacuum_start_daemon;
20 extern int autovacuum_max_workers;
21 extern int autovacuum_work_mem;
22 extern int autovacuum_naptime;
23 extern int autovacuum_vac_thresh;
24 extern double autovacuum_vac_scale;
25 extern int autovacuum_anl_thresh;
26 extern double autovacuum_anl_scale;
27 extern int autovacuum_freeze_max_age;
29 extern int autovacuum_vac_cost_delay;
30 extern int autovacuum_vac_cost_limit;
31 
32 /* autovacuum launcher PID, only valid when worker is shutting down */
33 extern int AutovacuumLauncherPid;
34 
36 
37 /* Status inquiry functions */
38 extern bool AutoVacuumingActive(void);
39 extern bool IsAutoVacuumLauncherProcess(void);
40 extern bool IsAutoVacuumWorkerProcess(void);
41 
42 #define IsAnyAutoVacuumProcess() \
43  (IsAutoVacuumLauncherProcess() || IsAutoVacuumWorkerProcess())
44 
45 /* Functions to start autovacuum process, called from postmaster */
46 extern void autovac_init(void);
47 extern int StartAutoVacLauncher(void);
48 extern int StartAutoVacWorker(void);
49 
50 /* called from postmaster when a worker could not be forked */
51 extern void AutoVacWorkerFailed(void);
52 
53 /* autovacuum cost-delay balancer */
54 extern void AutoVacuumUpdateDelay(void);
55 
56 #ifdef EXEC_BACKEND
57 extern void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn();
58 extern void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn();
59 extern void AutovacuumWorkerIAm(void);
60 extern void AutovacuumLauncherIAm(void);
61 #endif
62 
63 /* shared memory stuff */
64 extern Size AutoVacuumShmemSize(void);
65 extern void AutoVacuumShmemInit(void);
66 
67 #endif /* AUTOVACUUM_H */
Size AutoVacuumShmemSize(void)
Definition: autovacuum.c:3000
int autovacuum_max_workers
Definition: autovacuum.c:112
NON_EXEC_STATIC void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn()
Definition: autovacuum.c:407
void AutoVacuumUpdateDelay(void)
Definition: autovacuum.c:1714
int autovacuum_vac_thresh
Definition: autovacuum.c:115
int autovacuum_freeze_max_age
Definition: autovacuum.c:119
void AutoVacWorkerFailed(void)
Definition: autovacuum.c:1347
double autovacuum_vac_scale
Definition: autovacuum.c:116
void autovac_init(void)
Definition: autovacuum.c:2969
int autovacuum_vac_cost_delay
Definition: autovacuum.c:122
#define pg_attribute_noreturn()
Definition: c.h:649
NON_EXEC_STATIC void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn()
Definition: autovacuum.c:1469
bool IsAutoVacuumWorkerProcess(void)
Definition: autovacuum.c:2989
int autovacuum_multixact_freeze_max_age
Definition: autovacuum.c:120
int autovacuum_naptime
Definition: autovacuum.c:114
bool AutoVacuumingActive(void)
Definition: autovacuum.c:2955
bool IsAutoVacuumLauncherProcess(void)
Definition: autovacuum.c:2983
void AutoVacuumShmemInit(void)
Definition: autovacuum.c:3019
int autovacuum_vac_cost_limit
Definition: autovacuum.c:123
int AutovacuumLauncherPid
Definition: autovacuum.c:283
bool autovacuum_start_daemon
Definition: autovacuum.c:111
double autovacuum_anl_scale
Definition: autovacuum.c:118
int autovacuum_anl_thresh
Definition: autovacuum.c:117
size_t Size
Definition: c.h:353
int StartAutoVacLauncher(void)
Definition: autovacuum.c:369
int StartAutoVacWorker(void)
Definition: autovacuum.c:1431
int Log_autovacuum_min_duration
Definition: autovacuum.c:125
int autovacuum_work_mem
Definition: autovacuum.c:113