Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvDWM-008yti-1U for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Feb 2026 11:57:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvDWL-005pxe-0f for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Feb 2026 11:57:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvDWK-005pxW-2x for pgsql-hackers@lists.postgresql.org; Wed, 25 Feb 2026 11:57:36 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvDWG-00000001DF5-49Km for pgsql-hackers@postgresql.org; Wed, 25 Feb 2026 11:57:35 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-3870acaf78eso52913581fa.2 for ; Wed, 25 Feb 2026 03:57:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772020651; cv=none; d=google.com; s=arc-20240605; b=arehbxRfkJHi7E4Wze4CILbyVdP/GMeut0aGJTZueuJfdk0PWVGCbI2uxikoA0DfNv 8GRsB7kCnEMf4ZbUIVPKN+1RK/UMP4WGwVnQwUyP+xCN74rpWWaGKRX5BjP8BejZn5sX pSGLL8U7IodopqIvCNUfcv/ZDlmXHlEiupukS2GrvxJK0iXgBI3KaVc9KxE6qCc/JOss iZVHRrdNzbVyOQlCh6DftQ3w2zKQIlUbGc2qCEtodF37MckxB6H/HG47laGxDJa+5gZd sNWZhGKUltHnkdjOY3iksglBetHuNAfEP+ZJWV1QynB51xZuyqOE2xIHC4sxeIfuXFy1 jUHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Tj0oCQvYyL1m5x1m/VOuEqCTjcc8z5pBS0QHTaOs35E=; fh=qQjgYTk+dkIfAjY5o+btYWK1LMkQ5GDTJ84FucD67o0=; b=I5ouxUX1n+kwUIvmEOWm0WsZnyFqEMRsnClDTJdBq/hcFQDAMJeVLkgnHI/qyOu/6F YA0yuzzslNPA9oIovUMDxmLr2IWMfZkexR5zalaixd63HYjTRdUmbekUssEC9o94YxNx L2Sqcdt4xnUiGI/QbV4AeHd4QjzI98j6ic4SyVrjaq2FnoBw2hx/0rZqZFE6B+xYXSHO Q1kZ/cLN3UUyrA5ioANKRvCsD3Wx2FzaTYBb00dWQvAxsVm4Ai4h5+hYYsRgrvct2opn ug1o1RhecR4+6CX9mtf4O/OwiqCoenTorloO9+k14eXIn7HmL/+zrL+KMp6vE7lUCG0v gDhw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1772020651; x=1772625451; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Tj0oCQvYyL1m5x1m/VOuEqCTjcc8z5pBS0QHTaOs35E=; b=UBINmaLTKv/t2q2UyA1kLJY1cxaLbflvu9BiyhYRJPw8dcAEXPGaH8cJNWcRyekTUK XaMPypA2S9Ifc3z0+EyWaxzGCoTAikInRFzsf00vwvBz59VvUZiiV3rUr+EjoS52BTqZ XjJXBE96dTcQxvNQU0yqVKgUH9NOh5CwqQR87htBYxTHrC8hOGMGWzAAAI2S3ZZj/DiI OrtJpLpf5+74wry0o3pnqOO+NgfGCBVIpOHA/dnj2cPcmhJld+OCXJPI/ZwF6IP54a/Q jsPb238mlHq6iqaosnDsfgGZJS7jaa3oNHVeaGG0fj0YhQ+T3aklmiazrfXCqcE+rix2 xZ3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772020651; x=1772625451; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Tj0oCQvYyL1m5x1m/VOuEqCTjcc8z5pBS0QHTaOs35E=; b=fA72eQdsCYQ3vyEHiLRc3QJAC4Zh0A44JtMoW/Tk8s8kJgS5fhHZO3SGkj7aUpmVMG jl1N0d5wqWZOel+leXL715C8qcwgo9ds/i27jCG1L4KEW2zinmIB52tjJy390Dt6b2x4 3ZYE3H39pDiQiT0xXHPSv1HTmWGjl58bV8zV+VE7zb1BSnYYfyz9tF4Fl0UtlJPXZirY 7xA0HqMywDVYYpOKZSZJtZPlMBmux4rZtwPfx+cuX3Oynx6uZQ9ENi+DaCuv6X6LqG+R DJ96ordVK/gjvJjENAe6iaujwYXtSuEtaJkILpdym1m53BevkkGyJxACaAUQXx9QlV0I Pajw== X-Forwarded-Encrypted: i=1; AJvYcCUaDZ2WqkJ6zmaxxHBtfxXiHPxx6x+5pozbzzRBnyYuP2FXiMzNPef1ztJFGAfaWhOHBtoxTqdANzJWSSGX@postgresql.org X-Gm-Message-State: AOJu0YzMo7GmgWasoxMKeUsmdjn6ocBksBa68CD4Rcjsy4EWAPh835UZ /qcxVN9SyK8ePn+wZqWU7rQsJv752pj4AYTzp3lWyXgyrOGGyYVPboW4vE4HxIux3kXHgbzbdjH QM4rYsbIZIsakz4W2QzPwVV4BVy24iJdx9ZYNz5nr X-Gm-Gg: ATEYQzwcpwp3T1ZM8Zt5QSnQW73RZg5HzB4jM09Ypsjro3Q/wfhKDBNm2g0rZxCo/jO pC9jKhgOyd4kmyNKpMr2Fst8kHOsRpVZspGYsJSB4vwACm8y6dhKbkyItqntC9kZtVzx/6OoQf0 IMkLl9LdzN/TBqAtwnLYNPsJFLRs6niHKJGs02S6iEmNTs+K2ePsrKJRXC4zebKaZ22iMRS+d2J qYaj4fQ/jY3fCaJdeiK0PDULLYMYZtJ2kFVA0p+SaiT04A9owds/DgBNuY1/ekOqUktke9mh/cM KJYibpIWf9z8QXoEdA42gg3+TVVZ9tinAKESCcJlpl66uu1k7Ajy1KS2L/14wnngBsWnuywuOE5 e8A== X-Received: by 2002:a2e:b891:0:b0:385:bb24:d0eb with SMTP id 38308e7fff4ca-389a5e6823cmr50231091fa.34.1772020650999; Wed, 25 Feb 2026 03:57:30 -0800 (PST) MIME-Version: 1.0 References: <3bdce15d-25ec-4c49-9906-818803462897@gmail.com> <1e0462f0-8274-4d57-aa39-9b6ebeb954da@gmail.com> <41528b05-62be-4a5a-abd8-2af2dd84a1be@gmail.com> In-Reply-To: From: Jakub Wartak Date: Wed, 25 Feb 2026 12:57:19 +0100 X-Gm-Features: AaiRm53uz8wV_BA-IueBA4PCe2pWpdzfxwUbC_v7McodMTeLv8qc1rTvEOQGxoU Message-ID: Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc? To: Lukas Fittl Cc: Andres Freund , Hannu Krosing , Robert Haas , Pavel Stehule , vignesh C , Michael Paquier , Ibrar Ahmed , Maciek Sakrejda , pgsql-hackers , David Geier Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Feb 25, 2026 at 11:01=E2=80=AFAM Lukas Fittl wrot= e: [..] > 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 ou= t that set_tsc_frequency_khz() returns false and tsc_frequency_khz=3D=3D0 bef= ore 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 w= ay of informing users why he cannot SET timing_clock_source to TSC. Possibly errh= int() could differentiate the reason? E.g. "failed to auto-detect TSC frequency (potential hypervisor issue)" or "CPU RDTSCP instructions are not available" -J.