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 1pgfgz-0004zT-VY for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Mar 2023 05:46:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pgfgy-0000GP-QN for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Mar 2023 05:46:52 +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 1pgfgy-0000GD-FD for pgsql-hackers@lists.postgresql.org; Mon, 27 Mar 2023 05:46:52 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pgfgr-00031y-Oj for pgsql-hackers@lists.postgresql.org; Mon, 27 Mar 2023 05:46:51 +0000 Received: by mail-wm1-x329.google.com with SMTP id v20-20020a05600c471400b003ed8826253aso4435814wmo.0 for ; Sun, 26 Mar 2023 22:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679896003; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=s9mbM4n28T7RJwdk7OHoqd2UdbX3irorS5jOSvK6nEY=; b=plWLM1SBjyWuaW3a8Q2xx7zxA0rEFawAo0Jy/KhI09gL9PsCfNqYKrfRaQTe2HrySB BZGmC6KNann80A8MaWtfEwfULYZAIyDQukQe+rofkyxiJUXZwnfWxR5QptSTt0zUate+ igqLuZbCEZqCigvgYqy+HhFOI/VS/ayZqm8DqOtq4+5Qi3VWHbFWvoS4xMWwF+quFpmP ENuhUKWjjtjReoZc+g6CcnmcJuFfbSzUCQgAUzl22rDyx7vpfgTXl7vvjhwkblVpG0tD G/uaONarqiwyo1vModnBS2P5Xm0nkeTByT9CdwBPmLcB3P1OZCkjGCQ2ZqQ6iTGJYnCG +51g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679896003; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s9mbM4n28T7RJwdk7OHoqd2UdbX3irorS5jOSvK6nEY=; b=geIM4qi06bSFmpZ+ff2HKD2EMNvsCeIaZkDhlI3sN/OuBnqILyIX5k0JKfaHEeeyoF 63Sk8+DQsKVQeuyZBFEPKWX99JQpoz+iONaPu4mfczXggLNTgh3BSCUmHr1y+E8jzOGK IyySF5kikPZBfnkQcyLMNLV22d4M9uW48n8StB2sfdmKNLkMcz9bx23P45lghXFnAjJh GvNQvlKPrHIqnE7PC7vk1kmburtqIe6Pj8E98qooM5cXYJ8fE51wegiB68/c+k+vuP+s VUA5dgGtsxMYdelZLv+8c1yQtGYiTZ68b17PK2qWsYlCAwBGBCHF1+S/9qbxYIoxTFV5 MM9A== X-Gm-Message-State: AO0yUKU+gKypVOURWA78zvWL9OkH1yS3mmchEXodaFDI07NxtcKg96vz uYY4QH6seXfXQWqjVAoJ+a8= X-Google-Smtp-Source: AK7set+arba8ZWa80tvcoe9qaLIoWqCkHLYhnwyxt+JS8nx54dQfqqPNDZdN67ErDY/975M0VDpGyw== X-Received: by 2002:a1c:f60f:0:b0:3ea:e7e7:95d9 with SMTP id w15-20020a1cf60f000000b003eae7e795d9mr8449496wmc.32.1679896003189; Sun, 26 Mar 2023 22:46:43 -0700 (PDT) Received: from [192.168.5.158] ([54.239.6.184]) by smtp.gmail.com with ESMTPSA id f20-20020a1c6a14000000b003edcc2223c6sm12402722wmc.28.2023.03.26.22.46.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Mar 2023 22:46:42 -0700 (PDT) Message-ID: Date: Mon, 27 Mar 2023 07:45:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: Generate pg_stat_get_xact*() functions with Macros To: Michael Paquier Cc: "Gregory Stark (as CFM)" , Andres Freund , Michael Paquier , PostgreSQL Hackers References: <20230111225907.6el6c5j3hukizqxc@awork3.anarazel.de> <20230112182434.ejffbun4plv2g37k@awork3.anarazel.de> <83f7982d-272a-b064-8a0f-8853354edf10@gmail.com> <20230113183746.zyncqr2zz3gk6yh6@awork3.anarazel.de> <11744b0e-5f7f-aba8-7d9c-2ff0a0c6e2b2@gmail.com> <631e3084-c5d9-8463-7540-fcff4674caa5@gmail.com> Content-Language: en-US From: "Drouvot, Bertrand" In-Reply-To: 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, On 3/27/23 3:20 AM, Michael Paquier wrote: > On Sat, Mar 25, 2023 at 11:50:50AM +0900, Michael Paquier wrote: >> On Fri, Mar 24, 2023 at 06:58:30AM +0100, Drouvot, Bertrand wrote: >>> - Does not include the refactoring for >>> pg_stat_get_xact_function_total_time(), >>> pg_stat_get_xact_function_self_time(), >>> pg_stat_get_function_total_time() and >>> pg_stat_get_function_self_time(). I think they can be done in a >>> dedicated commit once we agree on the renaming for >>> PG_STAT_GET_DBENTRY_FLOAT8 (see Andres's comment up-thread) so that >>> the new macros can match the future agreement. > > Thanks for the reminder. I have completely missed that this is > mentioned in [1], and that it is all about 8018ffb. The suggestion to > prefix the macro names with a "_MS" to outline the conversion sounds > like a good one seen from here. So please find attached a patch to do > this adjustment, completed with a similar switch for the two counters > of the function entries. > Thanks! LGTM, but what about also taking care of pg_stat_get_xact_function_total_time() and pg_stat_get_xact_function_self_time() while at it? >>> - Does include the refactoring of the new >>> - pg_stat_get_xact_tuples_newpage_updated() function (added in >>> - ae4fdde135) >> >> Fine by me. One step is better than no steps, and this helps: >> 1 file changed, 29 insertions(+), 97 deletions(-) >> >> I'll go apply that if there are no objections. > > Just did this part to shave a bit more code. Thanks! Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com