aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2018-11-21 15:02:37 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2018-11-21 15:04:25 -0300
commit6f7d02aa60b711c2a61d12b2f2f7ff4c5d5d6df4 (patch)
treebecd7d89575e4110eb491d2a7b6e0e0726c671b7 /src/backend/executor
parent7306d5e920deb16f781797640715bf03f8d50d8c (diff)
downloadpostgresql-6f7d02aa60b711c2a61d12b2f2f7ff4c5d5d6df4.tar.gz
postgresql-6f7d02aa60b711c2a61d12b2f2f7ff4c5d5d6df4.zip
instr_time.h: add INSTR_TIME_SET_CURRENT_LAZY
Sets the timestamp to current if not already set. Will acquire more callers momentarily. Author: Fabien Coelho Discussion: https://postgr.es/m/alpine.DEB.2.21.1808111104320.1705@lancre
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/instrument.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/backend/executor/instrument.c b/src/backend/executor/instrument.c
index fe5d55904d2..0f2da221483 100644
--- a/src/backend/executor/instrument.c
+++ b/src/backend/executor/instrument.c
@@ -62,13 +62,9 @@ InstrInit(Instrumentation *instr, int instrument_options)
void
InstrStartNode(Instrumentation *instr)
{
- if (instr->need_timer)
- {
- if (INSTR_TIME_IS_ZERO(instr->starttime))
- INSTR_TIME_SET_CURRENT(instr->starttime);
- else
- elog(ERROR, "InstrStartNode called twice in a row");
- }
+ if (instr->need_timer &&
+ INSTR_TIME_SET_CURRENT_LAZY(instr->starttime))
+ elog(ERROR, "InstrStartNode called twice in a row");
/* save buffer usage totals at node entry, if needed */
if (instr->need_bufusage)