From f41551f61f9cf4eedd5b7173f985a3bdb4d9858c Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 18 Mar 2019 13:57:33 -0400 Subject: Fold vacuum's 'int options' parameter into VacuumParams. Many places need both, so this allows a few functions to take one fewer parameter. More importantly, as soon as we add a VACUUM option that takes a non-Boolean parameter, we need to replace 'int options' with a struct, and it seems better to think of adding more fields to VacuumParams rather than passing around both VacuumParams and a separate struct as well. Patch by me, reviewed by Masahiko Sawada Discussion: http://postgr.es/m/CA+Tgmob6g6-s50fyv8E8he7APfwCYYJ4z0wbZC2yZeSz=26CYQ@mail.gmail.com --- src/include/access/heapam.h | 2 +- src/include/commands/vacuum.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/include') diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index 1b6607fe902..eb9e160bfd9 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -217,7 +217,7 @@ extern Size SyncScanShmemSize(void); /* in heap/vacuumlazy.c */ struct VacuumParams; -extern void heap_vacuum_rel(Relation onerel, int options, +extern void heap_vacuum_rel(Relation onerel, struct VacuumParams *params, BufferAccessStrategy bstrategy); /* in heap/heapam_visibility.c */ diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h index 0a051ec06e2..c0df9c9054b 100644 --- a/src/include/commands/vacuum.h +++ b/src/include/commands/vacuum.h @@ -141,6 +141,7 @@ typedef struct VacAttrStats */ typedef struct VacuumParams { + int options; /* bitmask of VacuumOption */ int freeze_min_age; /* min freeze age, -1 to use default */ int freeze_table_age; /* age at which to scan whole table */ int multixact_freeze_min_age; /* min multixact freeze age, -1 to @@ -163,7 +164,7 @@ extern int vacuum_multixact_freeze_table_age; /* in commands/vacuum.c */ extern void ExecVacuum(VacuumStmt *vacstmt, bool isTopLevel); -extern void vacuum(int options, List *relations, VacuumParams *params, +extern void vacuum(List *relations, VacuumParams *params, BufferAccessStrategy bstrategy, bool isTopLevel); extern void vac_open_indexes(Relation relation, LOCKMODE lockmode, int *nindexes, Relation **Irel); @@ -194,10 +195,10 @@ extern void vacuum_delay_point(void); extern bool vacuum_is_relation_owner(Oid relid, Form_pg_class reltuple, int options); extern Relation vacuum_open_relation(Oid relid, RangeVar *relation, - VacuumParams *params, int options, LOCKMODE lmode); + int options, bool verbose, LOCKMODE lmode); /* in commands/analyze.c */ -extern void analyze_rel(Oid relid, RangeVar *relation, int options, +extern void analyze_rel(Oid relid, RangeVar *relation, VacuumParams *params, List *va_cols, bool in_outer_xact, BufferAccessStrategy bstrategy); extern bool std_typanalyze(VacAttrStats *stats); -- cgit v1.2.3