aboutsummaryrefslogtreecommitdiff
path: root/src/include/commands
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2019-03-18 15:14:52 -0400
committerRobert Haas <rhaas@postgresql.org>2019-03-18 15:14:52 -0400
commit6776142a07afb4c28961f27059d800196902f5f1 (patch)
treec71c15c97de920478294cba59d2f6e10d5935147 /src/include/commands
parentf41551f61f9cf4eedd5b7173f985a3bdb4d9858c (diff)
downloadpostgresql-6776142a07afb4c28961f27059d800196902f5f1.tar.gz
postgresql-6776142a07afb4c28961f27059d800196902f5f1.zip
Revise parse tree representation for VACUUM and ANALYZE.
Like commit f41551f61f9cf4eedd5b7173f985a3bdb4d9858c, this aims to make it easier to add non-Boolean options to VACUUM (or, in this case, to ANALYZE). Instead of building up a bitmap of options directly in the parser, build up a list of DefElem objects and let ExecVacuum() sort it out; right now, we make no use of the fact that a DefElem can carry an associated value, but it will be easy to make that change in the future. Masahiko Sawada Discussion: http://postgr.es/m/CAD21AoATE4sn0jFFH3NcfUZXkU2BMbjBWB_kDj-XWYA-LXDcQA@mail.gmail.com
Diffstat (limited to 'src/include/commands')
-rw-r--r--src/include/commands/vacuum.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h
index c0df9c9054b..77086f3e913 100644
--- a/src/include/commands/vacuum.h
+++ b/src/include/commands/vacuum.h
@@ -136,8 +136,23 @@ typedef struct VacAttrStats
int rowstride;
} VacAttrStats;
+typedef enum VacuumOption
+{
+ VACOPT_VACUUM = 1 << 0, /* do VACUUM */
+ VACOPT_ANALYZE = 1 << 1, /* do ANALYZE */
+ VACOPT_VERBOSE = 1 << 2, /* print progress info */
+ VACOPT_FREEZE = 1 << 3, /* FREEZE option */
+ VACOPT_FULL = 1 << 4, /* FULL (non-concurrent) vacuum */
+ VACOPT_SKIP_LOCKED = 1 << 5, /* skip if cannot get lock */
+ VACOPT_SKIPTOAST = 1 << 6, /* don't process the TOAST table, if any */
+ VACOPT_DISABLE_PAGE_SKIPPING = 1 << 7 /* don't skip any pages */
+} VacuumOption;
+
/*
* Parameters customizing behavior of VACUUM and ANALYZE.
+ *
+ * Note that at least one of VACOPT_VACUUM and VACOPT_ANALYZE must be set
+ * in options.
*/
typedef struct VacuumParams
{
@@ -163,7 +178,7 @@ extern int vacuum_multixact_freeze_table_age;
/* in commands/vacuum.c */
-extern void ExecVacuum(VacuumStmt *vacstmt, bool isTopLevel);
+extern void ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel);
extern void vacuum(List *relations, VacuumParams *params,
BufferAccessStrategy bstrategy, bool isTopLevel);
extern void vac_open_indexes(Relation relation, LOCKMODE lockmode,