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 1pISSb-0006Fh-Ro for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jan 2023 10:47:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pISSZ-0003Yf-Kn for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jan 2023 10:47:55 +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 1pISSZ-0003YW-C2 for pgsql-hackers@lists.postgresql.org; Thu, 19 Jan 2023 10:47:55 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pISSW-0000D6-1D for pgsql-hackers@postgresql.org; Thu, 19 Jan 2023 10:47:53 +0000 Received: by mail-ej1-x635.google.com with SMTP id qx13so4480999ejb.13 for ; Thu, 19 Jan 2023 02:47:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ES6fy80Qt7iJC9ZXRoAcC11TGJ/iTyXgzrMPjcO5jVw=; b=DjOL1GlHdEzvhqxTvn4gl+/e4Tmq882SkeKLg7Tk9bSIWm4COLTuUOcDlun+AG+HhV qR2zFJAcEhAvyuXsDXFYSEzp2BHBGOC4mWwqrn2qZQrEcsMP9txpe1rJhMviOsS2LxGa ZOeef+i1/ces4G0H4Ex6DfsJuNa7wD6Tu9m4Ni43c1/jqdJ3cmRDFbOdgE149ge1TWQa p28Z0yQAaTPJ6tdo+IQfXalhNL9fq2u4zcec825UBXTGTW5sAAL64Ih3QnQEQQ7rZj6L u8il2mc9H5CP/XyM7L9hYME0KVCqgpXMYD+bK6LwtdjsoByJdaY+dpYbG+6Z4iiDKXM+ JAiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ES6fy80Qt7iJC9ZXRoAcC11TGJ/iTyXgzrMPjcO5jVw=; b=grzQOnZBfI0Zcrkmx6IWjYXe8kR7AMOeAoFZdL1S7vVeXYtZ/jqNntAaCgSOZn/w0F ZytXy4SGfy2biLTQ5o8zxsqlfAXSecm86QWTX9iPIvufkOv/RGanoGxn40BGPtNaLQuD vkISURrKnKeVlbQEkOMxro5c0Rz0qKA1guxbTlIDW0BwFe51159PQNCMH7PM8QtT4zKn O+P5HW5pFb81dV7YWpPTu/5QW/MQUB+PpOQ8ufKhePi/kbndLr02CDp+sT8ThLrfwhgd 1vAo0Ez3Kt82OqAJ0KMa5G1bRkIidbXd11vHRj5cfnCdpsoY2KNgAyblBTnwIo59ypPe lYDg== X-Gm-Message-State: AFqh2konxXr6eQeI6BoH+jY/tO0JC+cNOZjDxg9uA8Rw/gVIoJa1G9FH 2p4/GVTUxqM4c+w0HYrqnI8= X-Google-Smtp-Source: AMrXdXsFB778qHnv2UisPMP7eSgjteq4c93tK3jHckCJ6lhfqzWQsjVMzmYV49OPYrxwjHAli3CTzg== X-Received: by 2002:a17:907:2587:b0:847:410:ecf0 with SMTP id ad7-20020a170907258700b008470410ecf0mr10202371ejc.20.1674125271206; Thu, 19 Jan 2023 02:47:51 -0800 (PST) Received: from [172.16.209.129] ([147.161.235.10]) by smtp.gmail.com with ESMTPSA id r18-20020a1709061bb200b0082000f8d871sm16086197ejg.152.2023.01.19.02.47.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Jan 2023 02:47:50 -0800 (PST) Message-ID: <50c9f291-fc60-1d2e-e286-0fb888586e7e@gmail.com> Date: Thu, 19 Jan 2023 11:47:49 +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? Content-Language: en-US To: Andres Freund , Robert Haas Cc: vignesh C , Lukas Fittl , Michael Paquier , Ibrar Ahmed , Maciek Sakrejda , pgsql-hackers References: <3eaeaa3a-b78e-ef0d-7319-5d713bbc09a0@gmail.com> <20230113195547.k4nlrmawpijqwlsa@awork3.anarazel.de> <20230117164758.gx4uuzhk5grw7zea@awork3.anarazel.de> From: David Geier In-Reply-To: <20230117164758.gx4uuzhk5grw7zea@awork3.anarazel.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Andres, > I also couldn't help and hacked a bit on the rdtsc pieces. I did figure out > how to do the cycles->nanosecond conversion with integer shift and multiply in > the common case, which does show a noticable speedup. But that's for another > day. I also have code for that here. I decided against integrating it because we don't convert frequently enough to make it matter. Or am I missing something? > I fought a bit with myself about whether to send those patches in this thread, > because it'll take over the CF entry. But decided that it's ok, given that > David's patches should be rebased over these anyway? That's alright. Though, I would hope we attempt to bring your patch set as well as the RDTSC patch set in. -- David Geier (ServiceNow)