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 1pQZnw-0003Fe-QG for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Feb 2023 20:15:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pQZnv-0006Y4-Mb for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Feb 2023 20:15:31 +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 1pQZnv-0006Xu-DW for pgsql-hackers@lists.postgresql.org; Fri, 10 Feb 2023 20:15:31 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQZnt-0007Ep-9j for pgsql-hackers@lists.postgresql.org; Fri, 10 Feb 2023 20:15:31 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 41C2F3200928; Fri, 10 Feb 2023 15:15:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 10 Feb 2023 15:15:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:date:date:from:from:in-reply-to:message-id:reply-to:sender :subject:subject:to:to; s=fm1; t=1676060123; x=1676146523; bh=0M UOaGR7NMnPon59Pxb3PSE6kS+r6u+H2ume+ZcjxZY=; b=BButzdTOqDHoLMDMdd Hsb3JzFQyXmdxfoT5QMOYewYBhj9zWNRzq2fax6L1Q5rqGvErkFOCZ6DoqaHwRO1 fkPlj7dsEuC+dsde83gmBn/XGjWm3EHnpjOu3HjOtgioqzweGEgqlzX5wttV/w+j xiXm6naDDLNZg3GnMrMAZAXCp6rLQB6FNHj2aH9t5i8m8+8AQrEqiixeK4zMbiC1 9c9SMeNTh5zboIGbZzXL3Bhxayva3Q6tjt7I//orJr3a6BdvsNn24Vwh3Kpj7pmK GixCFq2azNoh3LFJJSHceYq4AKoZiLmLJXqJ1YBcKQuHRW969rgn4lNKgKLuJCVa 3/Kw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1676060123; x=1676146523; bh=0MUOaGR7NMnPo n59Pxb3PSE6kS+r6u+H2ume+ZcjxZY=; b=XZ9BFhHe3U0DuHzeDe8HhQvTs2+/q 0rzsvLVNf9zcm6FvX9dPfxLcSufh4UNu0oC1UT58o0t+/pE1q7j7M01Fq+wR5+Hw Wep5+Sw94XokJaVvzS0q1WVsfqmqEfEfcYCq2zpGpVVB4ApsetbPaokLoSiSdJhH k6jdgNL76aawyhLY3U3i99JRYevC9+mIJc74Pe+e62YtZRD3wXS8cLbms/BBR8gE LwM7+YOSdM4FeN+RHkYQmS27W44xwpQT/sMC/v3M96KaDwBJeHYgkbHNeWXX8kQn CL9cRzP4dEw0+cdULoQWGKIuSohJW8zzLqz/8gNlN3izQFJ6k7vZPz9bA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudehhedgudeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffvfevuffkhfestddtredttddttdenucfhrhhomheptehnughrvghsucfh rhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrthhtvg hrnhepfedvtdeitdelhffhgfevieeljeelffevueefgfegveduvdfhkeejgfffleeuvefh necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghnug hrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Feb 2023 15:15:23 -0500 (EST) Date: Fri, 10 Feb 2023 12:15:22 -0800 To: "Drouvot, Bertrand" Cc: Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org Subject: Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry Message-ID: <20230210201522.5cn74vserozyj6pu@awork3.anarazel.de> From: Andres Freund List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk : Andres Freund References: <20230210.113242.699878230551547182.horikyota.ntt@gmail.com> <5420b28c-d33f-d25d-9f47-b06b8a2372ba@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5420b28c-d33f-d25d-9f47-b06b8a2372ba@gmail.com> Hi, On 2023-02-10 16:50:32 +0100, Drouvot, Bertrand wrote: > On 2/10/23 3:32 AM, Kyotaro Horiguchi wrote: > > The summarization is needed only by > > few callers but now that cost is imposed to the all callers along with > > additional palloc()/pfree() calls. That doesn't seem reasonable. > > > > I agree that's not the best approach..... I think it's completely fine to do unnecessary reconciliation for the _xact_ functions. They're not that commonly used, and very rarely is there a huge number of relations with lots of pending data across lots of subtransactions. > Let me come back with another proposal (thinking to increment reconciled > counters in pgstat_count_heap_insert(), pgstat_count_heap_delete() and > pgstat_count_heap_update()). Those are the performance crucial functions, we shouldn't do any additional work there if we can avoid it. Shifting cost from the "looking at transactional stats" side to the collecting stats side is the opposite of what we should. Greetings, Andres Freund