aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/vacuumdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/scripts/vacuumdb.c')
-rw-r--r--src/bin/scripts/vacuumdb.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c
index 125ed2ff5a4..a8bc6542196 100644
--- a/src/bin/scripts/vacuumdb.c
+++ b/src/bin/scripts/vacuumdb.c
@@ -408,7 +408,6 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
int i;
int ntups;
bool failed = false;
- bool parallel = concurrentCons > 1;
bool tables_listed = false;
bool has_where = false;
const char *stage_commands[] = {
@@ -651,25 +650,19 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
PQclear(res);
/*
- * If there are more connections than vacuumable relations, we don't need
- * to use them all.
+ * Ensure concurrentCons is sane. If there are more connections than
+ * vacuumable relations, we don't need to use them all.
*/
- if (parallel)
- {
- if (concurrentCons > ntups)
- concurrentCons = ntups;
- if (concurrentCons <= 1)
- parallel = false;
- }
+ if (concurrentCons > ntups)
+ concurrentCons = ntups;
+ if (concurrentCons <= 0)
+ concurrentCons = 1;
/*
* Setup the database connections. We reuse the connection we already have
* for the first slot. If not in parallel mode, the first slot in the
* array contains the connection.
*/
- if (concurrentCons <= 0)
- concurrentCons = 1;
-
slots = ParallelSlotsSetup(dbname, host, port, username, prompt_password,
progname, echo, conn, concurrentCons);