PostgreSQL Source Code git master
vacuuming.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * vacuuming.h
4 * Common declarations for vacuuming.c
5 *
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/bin/scripts/vacuuming.h
10 *
11 *-------------------------------------------------------------------------
12 */
13#ifndef VACUUMING_H
14#define VACUUMING_H
15
16#include "common.h"
19
20typedef enum
21{
26
27/* For analyze-in-stages mode */
28#define ANALYZE_NO_STAGE -1
29#define ANALYZE_NUM_STAGES 3
30
31/* vacuum options controlled by user flags */
32typedef struct vacuumingOptions
33{
36 bool verbose;
38 bool full;
39 bool freeze;
44 int parallel_workers; /* >= 0 indicates user specified the
45 * parallel degree, otherwise -1 */
54 bool echo;
55 bool quiet;
56 bool dry_run;
58
59/* Valid values for vacuumingOptions->objfilter */
60#define OBJFILTER_ALL_DBS 0x01 /* --all */
61#define OBJFILTER_DATABASE 0x02 /* --dbname */
62#define OBJFILTER_TABLE 0x04 /* --table */
63#define OBJFILTER_SCHEMA 0x08 /* --schema */
64#define OBJFILTER_SCHEMA_EXCLUDE 0x10 /* --exclude-schema */
65
66extern int vacuuming_main(ConnParams *cparams, const char *dbname,
67 const char *maintenance_db, vacuumingOptions *vacopts,
68 SimpleStringList *objects,
69 unsigned int tbl_count,
70 int concurrentCons,
71 const char *progname);
72
73extern char *escape_quotes(const char *src);
74
75#endif /* VACUUMING_H */
uint32 bits32
Definition: c.h:561
const char * progname
Definition: main.c:44
char * dbname
Definition: streamutil.c:49
bool force_index_cleanup
Definition: vacuuming.h:47
RunMode mode
Definition: vacuuming.h:34
bool no_index_cleanup
Definition: vacuuming.h:46
bits32 objfilter
Definition: vacuuming.h:35
int parallel_workers
Definition: vacuuming.h:44
bool disable_page_skipping
Definition: vacuuming.h:40
bool process_toast
Definition: vacuuming.h:50
char * buffer_usage_limit
Definition: vacuuming.h:52
bool missing_stats_only
Definition: vacuuming.h:53
bool skip_database_stats
Definition: vacuuming.h:51
char * escape_quotes(const char *src)
Definition: vacuuming.c:1043
RunMode
Definition: vacuuming.h:21
@ MODE_ANALYZE
Definition: vacuuming.h:23
@ MODE_VACUUM
Definition: vacuuming.h:22
@ MODE_ANALYZE_IN_STAGES
Definition: vacuuming.h:24
struct vacuumingOptions vacuumingOptions
int vacuuming_main(ConnParams *cparams, const char *dbname, const char *maintenance_db, vacuumingOptions *vacopts, SimpleStringList *objects, unsigned int tbl_count, int concurrentCons, const char *progname)
Definition: vacuuming.c:55