PostgreSQL Source Code: src/include/commands/vacuum.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef VACUUM_H
15#define VACUUM_H
16
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42#define VACUUM_OPTION_NO_PARALLEL 0
43
44
45
46
47
48#define VACUUM_OPTION_PARALLEL_BULKDEL (1 << 0)
49
50
51
52
53
54
55#define VACUUM_OPTION_PARALLEL_COND_CLEANUP (1 << 1)
56
57
58
59
60
61
62
63#define VACUUM_OPTION_PARALLEL_CLEANUP (1 << 2)
64
65
66#define VACUUM_OPTION_MAX_VALID_VALUE ((1 << 3) - 1)
67
68
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
107
109 bool *isNull);
110
113 int samplerows,
114 double totalrows);
115
117{
118
119
120
121
122
123
124
131
132
133
134
135
138 void *extra_data;
139
140
141
142
143
155
156
157
158
159
160
161
166
167
168
169
170
178
179
180#define VACOPT_VACUUM 0x01
181#define VACOPT_ANALYZE 0x02
182#define VACOPT_VERBOSE 0x04
183#define VACOPT_FREEZE 0x08
184#define VACOPT_FULL 0x10
185#define VACOPT_SKIP_LOCKED 0x20
186#define VACOPT_PROCESS_MAIN 0x40
187#define VACOPT_PROCESS_TOAST 0x80
188#define VACOPT_DISABLE_PAGE_SKIPPING 0x100
189#define VACOPT_SKIP_DATABASE_STATS 0x200
190#define VACOPT_ONLY_DATABASE_STATS 0x400
191
192
193
194
195
196
197
198
199
201{
207
208
209
210
211
212
213
214
215
216
218{
223
225
228
229
233
234
235
236
237
238
240
241
242
243
244
245
248
249
250
251
252
254{
255
256
257
260
261
262
263
264
265
266
267
268
269
270
271
272
273
276
277
278
279
280
281
282
283
286};
287
288
289
290
291
293{
297
298
308
309
310
311
312
313
314
315
316
318
319
320
321
322
323
324#define MAX_STATISTICS_TARGET 10000
325
326
330
334
336
337
341 bool isTopLevel);
343 int *nindexes, Relation **Irel);
348 double scanned_tuples);
351 double num_tuples,
354 bool hasindex,
357 bool *frozenxid_updated,
358 bool *minmulti_updated,
359 bool in_outer_xact);
376
377
380
381
383 int nindexes, int nrequested_workers,
384 int vac_work_mem, int elevel,
391 long num_table_tuples,
392 int num_index_scans);
394 long num_table_tuples,
395 int num_index_scans,
396 bool estimated_count);
398
399
404
405
408extern double anl_get_next_S(double t, int n, double *stateptr);
409
410#endif
TransactionId MultiXactId
FormData_pg_class * Form_pg_class
#define STATISTIC_NUM_SLOTS
FormData_pg_type * Form_pg_type
int16 stakind[STATISTIC_NUM_SLOTS]
MemoryContext anl_context
Oid statypid[STATISTIC_NUM_SLOTS]
Oid staop[STATISTIC_NUM_SLOTS]
Oid stacoll[STATISTIC_NUM_SLOTS]
char statypalign[STATISTIC_NUM_SLOTS]
float4 * stanumbers[STATISTIC_NUM_SLOTS]
bool statypbyval[STATISTIC_NUM_SLOTS]
int16 statyplen[STATISTIC_NUM_SLOTS]
int numvalues[STATISTIC_NUM_SLOTS]
Datum * stavalues[STATISTIC_NUM_SLOTS]
int numnumbers[STATISTIC_NUM_SLOTS]
AnalyzeAttrComputeStatsFunc compute_stats
TransactionId FreezeLimit
TransactionId relfrozenxid
MultiXactId MultiXactCutoff
int multixact_freeze_min_age
int multixact_freeze_table_age
VacOptValue index_cleanup
double max_eager_freeze_failure_rate
void ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel)
void VacuumUpdateCosts(void)
PGDLLIMPORT int VacuumCostBalanceLocal
TidStore * parallel_vacuum_get_dead_items(ParallelVacuumState *pvs, VacDeadItemsInfo **dead_items_info_p)
PGDLLIMPORT int vacuum_freeze_table_age
PGDLLIMPORT pg_atomic_uint32 * VacuumSharedCostBalance
PGDLLIMPORT int vacuum_cost_limit
bool std_typanalyze(VacAttrStats *stats)
void vac_open_indexes(Relation relation, LOCKMODE lockmode, int *nindexes, Relation **Irel)
void vacuum(List *relations, VacuumParams *params, BufferAccessStrategy bstrategy, MemoryContext vac_context, bool isTopLevel)
PGDLLIMPORT pg_atomic_uint32 * VacuumActiveNWorkers
PGDLLIMPORT double vacuum_cost_delay
double anl_get_next_S(double t, int n, double *stateptr)
PGDLLIMPORT int vacuum_failsafe_age
IndexBulkDeleteResult * vac_cleanup_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat)
ParallelVacuumState * parallel_vacuum_init(Relation rel, Relation *indrels, int nindexes, int nrequested_workers, int vac_work_mem, int elevel, BufferAccessStrategy bstrategy)
struct VacAttrStats VacAttrStats
PGDLLIMPORT bool VacuumFailsafeActive
PGDLLIMPORT int vacuum_freeze_min_age
void parallel_vacuum_bulkdel_all_indexes(ParallelVacuumState *pvs, long num_table_tuples, int num_index_scans)
PGDLLIMPORT int64 parallel_vacuum_worker_delay_ns
Relation vacuum_open_relation(Oid relid, RangeVar *relation, bits32 options, bool verbose, LOCKMODE lmode)
void parallel_vacuum_reset_dead_items(ParallelVacuumState *pvs)
void vac_close_indexes(int nindexes, Relation *Irel, LOCKMODE lockmode)
void parallel_vacuum_cleanup_all_indexes(ParallelVacuumState *pvs, long num_table_tuples, int num_index_scans, bool estimated_count)
Datum(* AnalyzeAttrFetchFunc)(VacAttrStatsP stats, int rownum, bool *isNull)
void vac_update_datfrozenxid(void)
void vacuum_delay_point(bool is_analyze)
PGDLLIMPORT bool vacuum_truncate
bool vacuum_get_cutoffs(Relation rel, const VacuumParams *params, struct VacuumCutoffs *cutoffs)
bool vacuum_xid_failsafe_check(const struct VacuumCutoffs *cutoffs)
@ VACOPTVALUE_UNSPECIFIED
PGDLLIMPORT int default_statistics_target
void parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
struct VacDeadItemsInfo VacDeadItemsInfo
struct VacAttrStats * VacAttrStatsP
PGDLLIMPORT int vacuum_multixact_freeze_table_age
PGDLLIMPORT int vacuum_multixact_freeze_min_age
double vac_estimate_reltuples(Relation relation, BlockNumber total_pages, BlockNumber scanned_pages, double scanned_tuples)
double anl_init_selection_state(int n)
PGDLLIMPORT bool track_cost_delay_timing
void(* AnalyzeAttrComputeStatsFunc)(VacAttrStatsP stats, AnalyzeAttrFetchFunc fetchfunc, int samplerows, double totalrows)
void analyze_rel(Oid relid, RangeVar *relation, VacuumParams *params, List *va_cols, bool in_outer_xact, BufferAccessStrategy bstrategy)
void AutoVacuumUpdateCostLimit(void)
struct VacuumParams VacuumParams
void parallel_vacuum_end(ParallelVacuumState *pvs, IndexBulkDeleteResult **istats)
bool vacuum_is_permitted_for_relation(Oid relid, Form_pg_class reltuple, bits32 options)
PGDLLIMPORT int vacuum_multixact_failsafe_age
void vac_update_relstats(Relation relation, BlockNumber num_pages, double num_tuples, BlockNumber num_all_visible_pages, BlockNumber num_all_frozen_pages, bool hasindex, TransactionId frozenxid, MultiXactId minmulti, bool *frozenxid_updated, bool *minmulti_updated, bool in_outer_xact)
double anl_random_fract(void)
IndexBulkDeleteResult * vac_bulkdel_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat, TidStore *dead_items, VacDeadItemsInfo *dead_items_info)
PGDLLIMPORT double vacuum_max_eager_freeze_failure_rate