Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

From: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
To: Lukas Fittl <lukas(at)fittl(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Hannu Krosing <hannuk(at)google(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, David Geier <geidav(dot)pg(at)gmail(dot)com>
Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?
Date: 2026-02-25 11:57:19
Message-ID: CAKZiRmwWKBzLmCjiENVOS8FijDsoOyCh29YwSiZcak61oM77DA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 25, 2026 at 11:01 AM Lukas Fittl <lukas(at)fittl(dot)com> wrote:
[..]
> See attached v9, rebased, with feedback addressed, unless otherwise noted.

FWIW, I've tried this on FreeBSD and I couldn't understand why I
couldn't enable TSC
(atlought) the cpuid tools reported RDTSCP being available. I have found out
that set_tsc_frequency_khz() returns false and tsc_frequency_khz==0 before even
inquiry for is_rdtscp_available() is done. As this was on virtualbox VM (so not
suppoprted by current code), I think this is pretty clear we'll need some way of
informing users why he cannot SET timing_clock_source to TSC. Possibly errhint()
could differentiate the reason? E.g.
"failed to auto-detect TSC frequency (potential hypervisor issue)" or
"CPU RDTSCP instructions are not available"

-J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2026-02-25 12:19:06 Re: [BUG?] estimate_hash_bucket_stats uses wrong ndistinct for avgfreq
Previous Message Álvaro Herrera 2026-02-25 11:53:57 Re: [PATCH] Add pg_get_database_ddl() function to reconstruct CREATE DATABASE statement