42 #define VACUUM_OPTION_NO_PARALLEL 0
48 #define VACUUM_OPTION_PARALLEL_BULKDEL (1 << 0)
55 #define VACUUM_OPTION_PARALLEL_COND_CLEANUP (1 << 1)
63 #define VACUUM_OPTION_PARALLEL_CLEANUP (1 << 2)
66 #define VACUUM_OPTION_MAX_VALID_VALUE ((1 << 3) - 1)
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
305 #define MAX_STATISTICS_TARGET 10000
327 double scanned_tuples);
335 bool *frozenxid_updated,
336 bool *minmulti_updated,
361 int nindexes,
int nrequested_workers,
362 int vac_work_mem,
int elevel,
369 long num_table_tuples,
370 int num_index_scans);
372 long num_table_tuples,
374 bool estimated_count);
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
void ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel)
void VacuumUpdateCosts(void)
IndexBulkDeleteResult * vac_bulkdel_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat, TidStore *dead_items, VacDeadItemsInfo *dead_items_info)
PGDLLIMPORT int VacuumCostBalanceLocal
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
void vac_update_relstats(Relation relation, BlockNumber num_pages, double num_tuples, BlockNumber num_all_visible_pages, bool hasindex, TransactionId frozenxid, MultiXactId minmulti, bool *frozenxid_updated, bool *minmulti_updated, bool in_outer_xact)
PGDLLIMPORT double vacuum_cost_delay
double anl_get_next_S(double t, int n, double *stateptr)
PGDLLIMPORT int vacuum_failsafe_age
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)
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 vacuum_delay_point(void)
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)
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)
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)
IndexBulkDeleteResult * vac_cleanup_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat)
TidStore * parallel_vacuum_get_dead_items(ParallelVacuumState *pvs, VacDeadItemsInfo **dead_items_info_p)
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
double anl_random_fract(void)