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 1nOI9K-0000Sd-3V for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Feb 2022 11:55:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nOI9I-0001u8-Is for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Feb 2022 11:55:36 +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 1nOI9I-0001tw-6x for pgsql-hackers@lists.postgresql.org; Sun, 27 Feb 2022 11:55:36 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nOI9F-0000EW-E3 for pgsql-hackers@postgresql.org; Sun, 27 Feb 2022 11:55:35 +0000 Received: by mail-pj1-x102c.google.com with SMTP id d15so5375572pjg.1 for ; Sun, 27 Feb 2022 03:55:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XPQU6FDDfcHphOWrr72g2cLInbLEoc+yI7YmXZQEIrg=; b=nZp2KVt8u9HyX0iRzVDpOeUB9BNFnoluyPioQLDLE7RnUetk3C502OYgpyjqZLbepx cF5HUM2UTxlrNspBkCq3nDecDblwJV6cCfYFEFeQ/2DFVus5I3Foe8xhC2T9OTc9VjDC 8GLJ+TO0BpuKV+SQNL2ArhftGORA7JI0Js1YQpWpXZ0aWJXJJgcXrfPMVwtDrIkn8UOr MGFWoDBomuT747TcmxQ8QoOvVwX7Onugkdup2UlwlZuxI8wGmUPTdlPlOgyZdwFTB3cV yJoBoMzn0xkUZL/GNyxdJgQScYSkWRWdvN1BJK6RJRFPzOfPl1dthjO8JKVT71LuNt13 +1LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XPQU6FDDfcHphOWrr72g2cLInbLEoc+yI7YmXZQEIrg=; b=NeLFKuWzKenOf1RYMeDlggiNvfCw1wpDtMY2edHtwZUbitdvF5EUYv2EAr+s7wyQZd xhERDPLNJ3aeGL20FU1ZOf0819s1zjWEPRKn+r5deFjLMApd61dApvKQKLhNXWk98t4j rYRzXhCFsNgIdVI3yy0bw30bdWYkjfHlzHWygHGtnOQAcfSerOBhbScdAarvxHednJcc d+dxhyNG/a1mLwNNbOJPBHi+xt0LlST0Y2d/XLVKtcbYUyha27mpnuSKmh/2HPVg0DSq AdyF72+mGwpajgPCuK9DJYCopOsUnK0RsmSuVWwNPMdv3i+aBeDRwOyj9O+0SudTF707 t2nw== X-Gm-Message-State: AOAM533pXmz+l20HgOy8u/8TC7sWl7zCfTFCVxMe8aRWAzx2PYFCp7/h o5bLQnnDFy7CV4BmEWogoCQ= X-Google-Smtp-Source: ABdhPJznm9Kvi+qTVQZZ824XElK3Kpgk3tl8pMnWEW0WWD2UDtdGiHfCyBeRMEf94jMCbpXn9KOFNQ== X-Received: by 2002:a17:90a:db44:b0:1bd:4c83:56f2 with SMTP id u4-20020a17090adb4400b001bd4c8356f2mr472915pjx.196.1645962930691; Sun, 27 Feb 2022 03:55:30 -0800 (PST) Received: from jrouhaud (2001-b011-1005-1c63-294b-db5e-8b5a-8836.dynamic-ip6.hinet.net. [2001:b011:1005:1c63:294b:db5e:8b5a:8836]) by smtp.gmail.com with ESMTPSA id i128-20020a626d86000000b004f3f2929d7asm3627186pfc.217.2022.02.27.03.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 03:55:30 -0800 (PST) Date: Sun, 27 Feb 2022 19:55:26 +0800 From: Julien Rouhaud To: Dong Wook Lee Cc: pgsql-hackers@postgresql.org Subject: Re: pg_stat_statements: remove redundant function call in pg_stat_statements_internal Message-ID: <20220227115526.vhpfhlinbruax5ky@jrouhaud> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sun, Feb 27, 2022 at 08:45:13PM +0900, Dong Wook Lee wrote: > > I found some redundant function calls in > pg_stat_statements.c/pg_stat_statements_internal(), > There is no need to call GetUserId() again because the value was > previously obtained. Indeed. I doubt it will make any real difference but it doesn't hurt to fix it. Patch looks good to me.