Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: 杨江华 <yjhjstz(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available
Date: 2025-03-27 03:09:42
Message-ID: 1817878.1743044982@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?B?5p2o5rGf5Y2O?= <yjhjstz(at)gmail(dot)com> writes:
> This patch modifies the instr_time.h header to prefer CLOCK_MONOTONIC_COARSE
> when available.

As far as I know, our usage of instr_time really needs the highest
resolution available, because we are usually trying to measure pretty
short intervals. You say that this patch reduces execution time,
and I imagine that's true ... but I wonder if it doesn't do so at
the cost of totally destroying the reliability of the output numbers.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-03-27 03:15:03 Re: support ALTER TABLE DROP EXPRESSION for virtual generated column
Previous Message Yurii Rashkovskii 2025-03-27 02:53:43 Re: Add Postgres module info