diff --git a/src/backend/executor/instrument.c b/src/backend/executor/instrument.c index edab92a0ebe..4c3930a4f86 100644 --- a/src/backend/executor/instrument.c +++ b/src/backend/executor/instrument.c @@ -170,7 +170,7 @@ InstrAggNode(Instrumentation *dst, Instrumentation *add) dst->firsttuple = add->firsttuple; } else if (dst->running && add->running && - INSTR_TIME_LT(dst->firsttuple, add->firsttuple)) + INSTR_TIME_GT(dst->firsttuple, add->firsttuple)) dst->firsttuple = add->firsttuple; INSTR_TIME_ADD(dst->counter, add->counter); diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 490593d1825..87b9ec95531 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -28,6 +28,8 @@ * * INSTR_TIME_ACCUM_DIFF(x, y, z) x += (y - z) * + * INSTR_TIME_GT(x, y) x > y + * * INSTR_TIME_GET_DOUBLE(t) convert t to double (in seconds) * * INSTR_TIME_GET_MILLISEC(t) convert t to double (in milliseconds) @@ -184,7 +186,7 @@ GetTimerFrequency(void) #define INSTR_TIME_ACCUM_DIFF(x,y,z) \ ((x).ticks += (y).ticks - (z).ticks) -#define INSTR_TIME_LT(x,y) \ +#define INSTR_TIME_GT(x,y) \ ((x).ticks > (y).ticks) #define INSTR_TIME_GET_DOUBLE(t) \