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 1pIl7C-0007H7-TG for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jan 2023 06:43:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pIl7B-0001Pk-Pr for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jan 2023 06:43:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIl7B-0001Pb-Gq for pgsql-hackers@lists.postgresql.org; Fri, 20 Jan 2023 06:43:05 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pIl79-0006VE-FW for pgsql-hackers@postgresql.org; Fri, 20 Jan 2023 06:43:05 +0000 Received: by mail-ed1-x52e.google.com with SMTP id x36so5551432ede.13 for ; Thu, 19 Jan 2023 22:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=YsINqGPL3nkTnPBwurf6zfcx1/I2y5ItieH4IJ8Ag9Y=; b=Qn4nsXnfidyRQf/qU9emr8v54mA3/FeX/oLZmAxhv8tOJGS2ampVKC4c+LywjIjjD7 ED9b2U3z8hR9qkpkc5Ph81Mmgh44NqjBWaaIRLEdKEa2GfdCC/eIVFTA5l2H1QOOOQY0 JY/b+K9RQHcQIYsXsIyYF94ddwi7geZmdYr6LA2AdwqyhDTm4r3BRH1bHFvxYYxuvBmM pj3zeCPxN5hb73Sue8dz5zeNdAA2mohdu9hQDgM3s1+qr7T/ryAD0HYLIbKZSjjKExqj qiC8s9PWZ1ptnl0vMrYJNwmROTQm5dNyN0tJJgPnYRuc1m//giPhi4+NEXKoFv83rtAE UkDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YsINqGPL3nkTnPBwurf6zfcx1/I2y5ItieH4IJ8Ag9Y=; b=PTZKztbioVI9OqGMpepb50DiAQm4GE4G6du6wrHYji/q0YY1hoZVyMbyS5Q68r9BWA WFpeeJGoIE8DWmxJuHpEjbaANnEqmgvs4zYVxRgPofQIKHrYQs3/oBhUYH58fa0fuTNF 379lLkAtrbGTVuTd5WniGd0gX6aeQ5vNz0P+QmYqesT2KRAz5gcI6pdChuLzOJyEXCWq wpug3FaSkRdClP3OtDQhl11SmTECLQxlIcKAqWwiGTMLt2pR5Zjk1NLQcP59zjM/T3m8 cwRE+O01cZ3y5Y5blJasDazgZ76oVg4S/h942dlrSFc45Pj9C1jQN98nO386X2zmsTPF grzw== X-Gm-Message-State: AFqh2kqqOUK38N7VYFNQK0gIYytGt5W9oTXsd0JbWhcekcObx5rch311 IC5aUB6xeVSgHzHIc6MvgNI= X-Google-Smtp-Source: AMrXdXtVESOgUSSQD9U2gvKL/hOq/qCH2NTVDqhR3GbfRP1xyvuIud4lhborZ5qzKRqHCyy3GlbMqQ== X-Received: by 2002:a05:6402:2207:b0:49d:f444:ed04 with SMTP id cq7-20020a056402220700b0049df444ed04mr12698515edb.17.1674196982794; Thu, 19 Jan 2023 22:43:02 -0800 (PST) Received: from [172.16.209.129] ([147.161.235.10]) by smtp.gmail.com with ESMTPSA id d7-20020a50fb07000000b0049cbd334b13sm8938256edq.29.2023.01.19.22.43.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Jan 2023 22:43:02 -0800 (PST) Message-ID: <24aa958f-0463-03d4-ce54-20b277c954c6@gmail.com> Date: Fri, 20 Jan 2023 07:43:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc? From: David Geier To: Pavel Stehule , Tomas Vondra Cc: vignesh C , Lukas Fittl , Michael Paquier , Ibrar Ahmed , Maciek Sakrejda , Andres Freund , pgsql-hackers References: <20200612232810.f46nbqkdhbutzqdg@alap3.anarazel.de> <20220701172639.ty4iu5almspueriu@alap3.anarazel.de> <3eaeaa3a-b78e-ef0d-7319-5d713bbc09a0@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/18/23 13:52, David Geier wrote: > On 1/16/23 21:39, Pavel Stehule wrote: >> >> po 16. 1. 2023 v 21:34 odesílatel Tomas Vondra >> napsal: >> >>     Hi, >> >>     there's minor bitrot in the Mkvcbuild.pm change, making cfbot >> unhappy. >> >>     As for the patch, I don't have much comments. I'm wondering if >> it'd be >>     useful to indicate which timing source was actually used for EXPLAIN >>     ANALYZE, say something like: >> >>      Planning time: 0.197 ms >>      Execution time: 0.225 ms >>      Timing source: clock_gettime (or tsc) >> >> +1 > > I like the idea of exposing the timing source in the EXPLAIN ANALYZE > output. > It's a good tradeoff between inspectability and effort, given that > RDTSC should always be better to use. > If there are no objections I go this way. Thinking about this a little more made me realize that this will cause different pg_regress output depending on the platform. So if we go this route we would at least need an option for EXPLAIN ANALYZE to disable it. Or rather have it disabled by default and allow for enabling it. Thoughts? -- David Geier (ServiceNow)