From 4509d9a72be6498626c2b2814da6ab28e5fa283f Mon Sep 17 00:00:00 2001 From: SaitTalhaNisanci Date: Mon, 9 Mar 2020 14:54:01 +0300 Subject: [PATCH] Create a variable SLOW_START_DISABLED (#3593) When ExecutorSlowStartInterval is set to 0, it has a special meaning that we do not want to use slow start. Therefore, in the code we have checks such as ExecutorSlowStartInterval > 0 to understand if it is enabled or not. However, this is kind of subtle, and it creates an extra mapping in our mind. Therefore, I thought that using a variable for the special value removes the mapping and makes it easier to understand. --- src/backend/distributed/executor/adaptive_executor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/distributed/executor/adaptive_executor.c b/src/backend/distributed/executor/adaptive_executor.c index bd673e9f4..a7dc7c67f 100644 --- a/src/backend/distributed/executor/adaptive_executor.c +++ b/src/backend/distributed/executor/adaptive_executor.c @@ -165,6 +165,8 @@ #include "utils/memutils.h" #include "utils/timestamp.h" +#define SLOW_START_DISABLED 0 + /* * DistributedExecution represents the execution of a distributed query @@ -2257,7 +2259,7 @@ ManageWorkerPool(WorkerPool *workerPool) */ newConnectionCount = Min(newConnectionsForReadyTasks, maxNewConnectionCount); - if (newConnectionCount > 0 && ExecutorSlowStartInterval > 0) + if (newConnectionCount > 0 && ExecutorSlowStartInterval != SLOW_START_DISABLED) { if (MillisecondsPassedSince(workerPool->lastConnectionOpenTime) >= ExecutorSlowStartInterval)