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 #include "storage/block.h"
18 
19 /*
20  * Other processes can request specific work from autovacuum, identified by
21  * AutoVacuumWorkItem elements.
22  */
23 typedef enum
24 {
27 
28 
29 /* GUC variables */
30 extern bool autovacuum_start_daemon;
31 extern int autovacuum_max_workers;
32 extern int autovacuum_work_mem;
33 extern int autovacuum_naptime;
34 extern int autovacuum_vac_thresh;
35 extern double autovacuum_vac_scale;
36 extern int autovacuum_anl_thresh;
37 extern double autovacuum_anl_scale;
38 extern int autovacuum_freeze_max_age;
40 extern int autovacuum_vac_cost_delay;
41 extern int autovacuum_vac_cost_limit;
42 
43 /* autovacuum launcher PID, only valid when worker is shutting down */
44 extern int AutovacuumLauncherPid;
45 
47 
48 /* Status inquiry functions */
49 extern bool AutoVacuumingActive(void);
50 extern bool IsAutoVacuumLauncherProcess(void);
51 extern bool IsAutoVacuumWorkerProcess(void);
52 
53 #define IsAnyAutoVacuumProcess() \
54  (IsAutoVacuumLauncherProcess() || IsAutoVacuumWorkerProcess())
55 
56 /* Functions to start autovacuum process, called from postmaster */
57 extern void autovac_init(void);
58 extern int StartAutoVacLauncher(void);
59 extern int StartAutoVacWorker(void);
60 
61 /* called from postmaster when a worker could not be forked */
62 extern void AutoVacWorkerFailed(void);
63 
64 /* autovacuum cost-delay balancer */
65 extern void AutoVacuumUpdateDelay(void);
66 
67 #ifdef EXEC_BACKEND
68 extern void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn();
69 extern void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn();
70 extern void AutovacuumWorkerIAm(void);
71 extern void AutovacuumLauncherIAm(void);
72 #endif
73 
75  Oid relationId, BlockNumber blkno);
76 
77 /* shared memory stuff */
78 extern Size AutoVacuumShmemSize(void);
79 extern void AutoVacuumShmemInit(void);
80 
81 #endif /* AUTOVACUUM_H */
AutoVacuumWorkItemType
Definition: autovacuum.h:23
Size AutoVacuumShmemSize(void)
Definition: autovacuum.c:3267
int autovacuum_max_workers
Definition: autovacuum.c:115
NON_EXEC_STATIC void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn()
Definition: autovacuum.c:433
void AutoVacuumUpdateDelay(void)
Definition: autovacuum.c:1760
int autovacuum_vac_thresh
Definition: autovacuum.c:118
int autovacuum_freeze_max_age
Definition: autovacuum.c:122
void AutoVacWorkerFailed(void)
Definition: autovacuum.c:1393
double autovacuum_vac_scale
Definition: autovacuum.c:119
uint32 BlockNumber
Definition: block.h:31
void autovac_init(void)
Definition: autovacuum.c:3236
int autovacuum_vac_cost_delay
Definition: autovacuum.c:125
unsigned int Oid
Definition: postgres_ext.h:31
NON_EXEC_STATIC void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn()
Definition: autovacuum.c:1515
bool IsAutoVacuumWorkerProcess(void)
Definition: autovacuum.c:3256
int autovacuum_multixact_freeze_max_age
Definition: autovacuum.c:123
int autovacuum_naptime
Definition: autovacuum.c:117
bool AutoVacuumingActive(void)
Definition: autovacuum.c:3187
bool IsAutoVacuumLauncherProcess(void)
Definition: autovacuum.c:3250
void AutoVacuumShmemInit(void)
Definition: autovacuum.c:3286
void AutoVacuumRequestWork(AutoVacuumWorkItemType type, Oid relationId, BlockNumber blkno)
Definition: autovacuum.c:3198
int autovacuum_vac_cost_limit
Definition: autovacuum.c:126
int AutovacuumLauncherPid
Definition: autovacuum.c:306
bool autovacuum_start_daemon
Definition: autovacuum.c:114
double autovacuum_anl_scale
Definition: autovacuum.c:121
int autovacuum_anl_thresh
Definition: autovacuum.c:120
size_t Size
Definition: c.h:350
int StartAutoVacLauncher(void)
Definition: autovacuum.c:395
#define pg_attribute_noreturn()
Definition: c.h:642
int StartAutoVacWorker(void)
Definition: autovacuum.c:1477
int Log_autovacuum_min_duration
Definition: autovacuum.c:128
int autovacuum_work_mem
Definition: autovacuum.c:116