pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: instrumentation: Keep time fields as instrtime, convert in calle
Date: Fri, 09 Jan 2026 18:57:47 +0000
Message-ID: <E1veHgA-005YFJ-0j@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e5a5e0a90750d665cab417322b9f85c806430d85

Modified Files
--------------
contrib/auto_explain/auto_explain.c             |  2 +-
contrib/pg_stat_statements/pg_stat_statements.c |  2 +-
src/backend/commands/explain.c                  | 14 ++++++++------
src/backend/executor/instrument.c               | 21 +++++++++------------
src/include/executor/instrument.h               |  6 +++---
src/include/portability/instr_time.h            |  2 ++
6 files changed, 24 insertions(+), 23 deletions(-)



Message-ID: <E1veHgA-005YFJ-0j@gemulon.postgresql.org>
Permalink:  ../E1veHgA-005YFJ-0j@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1veHgA-005YFJ-0j@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: instrumentation: Keep time fields as instrtime, convert in calle
  In-Reply-To: <E1veHgA-005YFJ-0j@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox