]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
instrumentation: Rename INSTR_TIME_LT macro to INSTR_TIME_GT
authorAndres Freund <andres@anarazel.de>
Thu, 26 Feb 2026 15:19:23 +0000 (10:19 -0500)
committerAndres Freund <andres@anarazel.de>
Thu, 26 Feb 2026 15:38:59 +0000 (10:38 -0500)
This was incorrectly named "LT" for "larger than" in e5a5e0a90750d66, but
that is against existing conventions, where "LT" means "less than".
Clarify by using "GT" for "greater than" in macro name, and add a missing
comment at the top of instr_time.h to note the macro's existence.

Reported by: Peter Smith <smithpb2250@gmail.com>
Author: Lukas Fittl <lukas@fittl.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CAHut%2BPut94CTpjQsqOJHdHkgJ2ZXq%2BqVSfMEcmDKLiWLW-hPfA%40mail.gmail.com

src/backend/executor/instrument.c
src/include/portability/instr_time.h

index edab92a0ebeda14946564e2642a727b43c69276b..4c3930a4f868009924a9a3aded326a956070256d 100644 (file)
@@ -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);
index 490593d182512e80bc232cad34d6c0679b5f5f44..87b9ec95531b973526360f785a3ce6bb84502a7e 100644 (file)
@@ -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) \