PostgreSQL Source Code  git master
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-2022, 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 */
35 extern PGDLLIMPORT double autovacuum_vac_scale;
39 extern PGDLLIMPORT double autovacuum_anl_scale;
44 
45 /* autovacuum launcher PID, only valid when worker is shutting down */
47 
49 
50 /* Status inquiry functions */
51 extern bool AutoVacuumingActive(void);
52 extern bool IsAutoVacuumLauncherProcess(void);
53 extern bool IsAutoVacuumWorkerProcess(void);
54 
55 #define IsAnyAutoVacuumProcess() \
56  (IsAutoVacuumLauncherProcess() || IsAutoVacuumWorkerProcess())
57 
58 /* Functions to start autovacuum process, called from postmaster */
59 extern void autovac_init(void);
60 extern int StartAutoVacLauncher(void);
61 extern int StartAutoVacWorker(void);
62 
63 /* called from postmaster when a worker could not be forked */
64 extern void AutoVacWorkerFailed(void);
65 
66 /* autovacuum cost-delay balancer */
67 extern void AutoVacuumUpdateDelay(void);
68 
69 #ifdef EXEC_BACKEND
70 extern void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn();
71 extern void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn();
72 extern void AutovacuumWorkerIAm(void);
73 extern void AutovacuumLauncherIAm(void);
74 #endif
75 
77  Oid relationId, BlockNumber blkno);
78 
79 /* shared memory stuff */
80 extern Size AutoVacuumShmemSize(void);
81 extern void AutoVacuumShmemInit(void);
82 
83 #endif /* AUTOVACUUM_H */
NON_EXEC_STATIC void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn()
Definition: autovacuum.c:1509
NON_EXEC_STATIC void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn()
Definition: autovacuum.c:431
AutoVacuumWorkItemType
Definition: autovacuum.h:24
@ AVW_BRINSummarizeRange
Definition: autovacuum.h:25
int StartAutoVacWorker(void)
Definition: autovacuum.c:1471
void AutoVacuumUpdateDelay(void)
Definition: autovacuum.c:1781
PGDLLIMPORT double autovacuum_vac_scale
Definition: autovacuum.c:121
PGDLLIMPORT int autovacuum_anl_thresh
Definition: autovacuum.c:124
PGDLLIMPORT int autovacuum_vac_thresh
Definition: autovacuum.c:120
PGDLLIMPORT int autovacuum_vac_ins_thresh
Definition: autovacuum.c:122
PGDLLIMPORT int autovacuum_vac_cost_limit
Definition: autovacuum.c:130
Size AutoVacuumShmemSize(void)
Definition: autovacuum.c:3325
int StartAutoVacLauncher(void)
void AutoVacuumShmemInit(void)
Definition: autovacuum.c:3344
PGDLLIMPORT double autovacuum_anl_scale
Definition: autovacuum.c:125
bool AutoVacuumRequestWork(AutoVacuumWorkItemType type, Oid relationId, BlockNumber blkno)
Definition: autovacuum.c:3252
bool AutoVacuumingActive(void)
Definition: autovacuum.c:3240
PGDLLIMPORT double autovacuum_vac_ins_scale
Definition: autovacuum.c:123
PGDLLIMPORT int autovacuum_work_mem
Definition: autovacuum.c:118
PGDLLIMPORT int autovacuum_freeze_max_age
Definition: autovacuum.c:126
PGDLLIMPORT int autovacuum_naptime
Definition: autovacuum.c:119
bool IsAutoVacuumLauncherProcess(void)
Definition: autovacuum.c:3308
PGDLLIMPORT double autovacuum_vac_cost_delay
Definition: autovacuum.c:129
void AutoVacWorkerFailed(void)
Definition: autovacuum.c:1411
bool IsAutoVacuumWorkerProcess(void)
Definition: autovacuum.c:3314
PGDLLIMPORT int AutovacuumLauncherPid
Definition: autovacuum.c:304
void autovac_init(void)
Definition: autovacuum.c:3294
PGDLLIMPORT bool autovacuum_start_daemon
Definition: autovacuum.c:116
PGDLLIMPORT int autovacuum_max_workers
Definition: autovacuum.c:117
PGDLLIMPORT int Log_autovacuum_min_duration
Definition: autovacuum.c:132
PGDLLIMPORT int autovacuum_multixact_freeze_max_age
Definition: autovacuum.c:127
uint32 BlockNumber
Definition: block.h:31
#define PGDLLIMPORT
Definition: c.h:1252
#define pg_attribute_noreturn()
Definition: c.h:201
size_t Size
Definition: c.h:541
unsigned int Oid
Definition: postgres_ext.h:31