instrumentation: Keep time fields as instrtime, convert in callers
Andres Freund <andres@anarazel.de>
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
Files
| Path | Change | +/− |
|---|---|---|
| contrib/auto_explain/auto_explain.c | modified | +1 −1 |
| contrib/pg_stat_statements/pg_stat_statements.c | modified | +1 −1 |
| src/backend/commands/explain.c | modified | +8 −6 |
| src/backend/executor/instrument.c | modified | +9 −12 |
| src/include/executor/instrument.h | modified | +3 −3 |
| src/include/portability/instr_time.h | modified | +2 −0 |
Discussion
- Stack-based tracking of per-node WAL/buffer usage 48 messages · 2025-08-31 → 2026-04-08