Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pGQcH-0004cY-4f for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 20:25:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pGQcF-0000x1-I8 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 20:25:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pGQcF-0000ws-8s for pgsql-hackers@lists.postgresql.org; Fri, 13 Jan 2023 20:25:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pGQc8-0000Ls-E7 for pgsql-hackers@postgresql.org; Fri, 13 Jan 2023 20:25:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 30DKPGYV294645; Fri, 13 Jan 2023 15:25:17 -0500 From: Tom Lane To: Andres Freund cc: David Geier , vignesh C , Lukas Fittl , Michael Paquier , Ibrar Ahmed , Maciek Sakrejda , pgsql-hackers Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc? In-reply-to: <20230113195547.k4nlrmawpijqwlsa@awork3.anarazel.de> References: <3eaeaa3a-b78e-ef0d-7319-5d713bbc09a0@gmail.com> <20230113195547.k4nlrmawpijqwlsa@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 13 Jan 2023 11:55:47 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <294642.1673641516.1@sss.pgh.pa.us> Date: Fri, 13 Jan 2023 15:25:16 -0500 Message-ID: <294643.1673641516@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2023-01-04 13:02:05 +0100, David Geier wrote: >> Subject: [PATCH 1/3] Change instr_time to just store nanoseconds, that's >> cheaper. > Does anybody see a reason to not move forward with this aspect? We do a fair > amount of INSTR_TIME_ACCUM_DIFF() etc, and that gets a good bit cheaper by > just using nanoseconds. Cheaper, and perhaps more accurate too? Don't recall if we have any code paths where the input timestamps are likely to be better-than-microsecond, but surely that's coming someday. I'm unsure that we want to deal with rdtsc's vagaries in general, but no objection to changing instr_time. regards, tom lane