diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 9081f09..2d2e0f6 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -107,6 +107,8 @@ extern int optind;
int nxacts = 0; /* number of transactions per client */
int duration = 0; /* duration in seconds */
+int is_no_vacuum = 0; /* suppress all vacuuming? */
+
/*
* scaling factor. for example, scale = 10 will make 1000000 tuples in
* pgbench_accounts table.
@@ -359,7 +361,6 @@ usage(const char *progname)
" -l write transaction times to log file\n"
" -M {simple|extended|prepared}\n"
" protocol for submitting queries to server (default: simple)\n"
- " -n do not run VACUUM before tests\n"
" -N do not update tables \"pgbench_tellers\" and \"pgbench_branches\"\n"
" -r report average latency per command\n"
" -s NUM report this scale factor in output\n"
@@ -372,6 +373,7 @@ usage(const char *progname)
" -h HOSTNAME database server host or socket directory\n"
" -p PORT database server port number\n"
" -U USERNAME connect as specified database user\n"
+ " -n do not run VACUUM\n"
" --help show this help, then exit\n"
" --version output version information, then exit\n"
"\n"
@@ -1422,13 +1424,16 @@ init(void)
}
/* vacuum */
- fprintf(stderr, "vacuum...");
- executeStatement(con, "vacuum analyze pgbench_branches");
- executeStatement(con, "vacuum analyze pgbench_tellers");
- executeStatement(con, "vacuum analyze pgbench_accounts");
- executeStatement(con, "vacuum analyze pgbench_history");
+ if (!is_no_vacuum)
+ {
+ fprintf(stderr, "vacuum...");
+ executeStatement(con, "vacuum analyze pgbench_branches");
+ executeStatement(con, "vacuum analyze pgbench_tellers");
+ executeStatement(con, "vacuum analyze pgbench_accounts");
+ executeStatement(con, "vacuum analyze pgbench_history");
+ fprintf(stderr, "done.\n");
+ }
- fprintf(stderr, "done.\n");
PQfinish(con);
}
@@ -1842,7 +1847,6 @@ main(int argc, char **argv)
int nclients = 1; /* default number of simulated clients */
int nthreads = 1; /* default number of threads */
int is_init_mode = 0; /* initialize mode? */
- int is_no_vacuum = 0; /* no vacuum at all before testing? */
int do_vacuum_accounts = 0; /* do vacuum accounts before testing? */
int ttype = 0; /* transaction type. 0: TPC-B, 1: SELECT only,
* 2: skip update of branches and tellers */
diff --git a/doc/src/sgml/pgbench.sgml b/doc/src/sgml/pgbench.sgml
index 2ae3b9e..cc12862 100644
--- a/doc/src/sgml/pgbench.sgml
+++ b/doc/src/sgml/pgbench.sgml
@@ -300,20 +300,6 @@ pgbench options> dbname>
-
-
-
- Perform no vacuuming before running the test.
- This option is necessary>
- if you are running a custom test scenario that does not include
- the standard tables pgbench_accounts>,
- pgbench_branches>, pgbench_history>, and
- pgbench_tellers>.
-
-
-
-
-
@@ -432,6 +418,22 @@ pgbench options> dbname>
+
+
+
+
+ Perform no vacuuming. In initialization mode, this suppresses the
+ vacuum commands that are normally performed after initialization;
+ in benchmarking mode, it suppresses those normally performed before
+ running the test. This option is necessary>
+ if you are running a custom test scenario that does not include
+ the standard tables pgbench_accounts>,
+ pgbench_branches>, pgbench_history>, and
+ pgbench_tellers>.
+
+
+
+