]> git.ipfire.org Git - thirdparty/postgresql.git/commit
instrumentation: Keep time fields as instrtime, convert in callers
authorAndres Freund <andres@anarazel.de>
Fri, 9 Jan 2026 17:10:53 +0000 (12:10 -0500)
committerAndres Freund <andres@anarazel.de>
Fri, 9 Jan 2026 18:38:00 +0000 (13:38 -0500)
commite5a5e0a90750d665cab417322b9f85c806430d85
tree7a38b285977ea130d4df5de0fc3f2ab52bee6be9
parentbba81f9d3d4f512280bd55751a450dac6f02d406
instrumentation: Keep time fields as instrtime, convert in callers

Previously the instrumentation logic always converted to seconds, only for
many of the callers to do unnecessary division to get to milliseconds. As an
upcoming refactoring will split the Instrumentation struct, utilize instrtime
always to keep things simpler. It's also a bit faster to not have to first
convert to a double in functions like InstrEndLoop(), InstrAggNode().

Author: Lukas Fittl <lukas@fittl.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CAP53PkzZ3UotnRrrnXWAv=F4avRq9MQ8zU+bxoN9tpovEu6fGQ@mail.gmail.com
contrib/auto_explain/auto_explain.c
contrib/pg_stat_statements/pg_stat_statements.c
src/backend/commands/explain.c
src/backend/executor/instrument.c
src/include/executor/instrument.h
src/include/portability/instr_time.h