Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

From: Lukas Fittl <lukas(at)fittl(dot)com>
To: David Geier <geidav(dot)pg(at)gmail(dot)com>
Cc: John Naylor <johncnaylorls(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, 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>
Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?
Date: 2026-03-24 06:09:57
Message-ID: CAP53Pkzom4D8qT_CSNaJggV4avR1=FN6dFuiSRB5BZuYts7e=A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi David,

On Mon, Mar 23, 2026 at 1:00 AM David Geier <geidav(dot)pg(at)gmail(dot)com> wrote:
> > TSC calibration improvements:
> > - Pass TSC frequency to child processes for EXEC_BACKEND, this makes
> > TSC calibration usable on Windows, per off-list suggestion from Andres
> > - To support the EXEC_BACKEND change, refactor tsc_frequency_khz to
> > have a sentinel value of -1 indicating the TSC was not initialized, vs
> > 0 indicating it was initialized but isn't usable, and drop
> > has_usable_tsc variable
>
> Have you tested the latest patch set on Windows? Let me know if you want
> me to do that.

Not outside of CI - so if you could do testing on Windows, that'd be great!

FWIW, CI does now exercise the TSC calibration logic on Windows, which
is part why the last patch set added the handling of EXEC_BACKEND to
pass down the frequency to the client connections, because I otherwise
saw this impacting Windows CI runtimes - they're normal with the
version posted.

Thanks,
Lukas

--
Lukas Fittl

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2026-03-24 06:11:33 Track skipped tables during autovacuum and autoanalyze
Previous Message Lukas Fittl 2026-03-24 06:03:16 Re: Stack-based tracking of per-node WAL/buffer usage