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 1pf79t-0000AR-9W for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Mar 2023 22:42:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pf79r-0002q2-Iq for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Mar 2023 22:42:15 +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 1pf79r-0002ps-9P for pgsql-hackers@lists.postgresql.org; Wed, 22 Mar 2023 22:42:15 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pf79o-0007pU-BI for pgsql-hackers@lists.postgresql.org; Wed, 22 Mar 2023 22:42:14 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4DDC05C0062; Wed, 22 Mar 2023 18:42:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 22 Mar 2023 18:42:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1679524931; x=1679611331; bh=qW 2nNs7YN+K8Lau7Ne8DSd5br6wFYqvJIXI/FMthgrg=; b=S6BOp2lUkLJlUN63tE yQaMeamV6gqPvs4Cg7cMzPqUHQIdnOL76XUle3m55xlGW7QYky5jaLtOSLKFRkVh HQrxJZME49k113j64/q/Y7EvLD0HyFo9neRX/oKuXALbvxVz/9f0YXplyqprQVFW Vd+PouOdliJm/Ora9+yvCbXml0Fl1QOCm+yV4fyAydCD0X1CjvLL3p7OTe9Ibjha eLkaDzOcKwtsjOCn088VfvX7fSEyObUlI9m9QPCghqBCWob6vZ56DBPdjWvJV0Kc 1T3rJaPZnD8d8pRdMbSYJZX/54s62zMT2fiHK2feRfZKeBJYDt9hdVFwfVhbinFW WSNw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1679524931; x=1679611331; bh=qW2nNs7YN+K8L au7Ne8DSd5br6wFYqvJIXI/FMthgrg=; b=lA2uRzOvpq35SjVGgiy4sWZa0hdfZ ODOBejDxFbBWbcDAR8zVYJbkJBBkoNx4LXUu+IenEnBfrjweSZWI/8fktj2GqRDa Y+fSTdM1Hb44EEDzf0hZu4Gsdxmhn6qtHBUR/jr5+1e0BEFQIVdQP7QOmHYgv9Ee TBN9ynXM11+JLRUZ+gxXhg3Gso3PFBxjndw6b4LwyZBaFSDiyV3w94eWFLTxNWNy +isHh4/pSTmicEdX+GzmWi+ZcEVR8aK/0ueRhbxFEc7WpozKrvoMFzywjATGtsMA M/A7+0arcvfMm6FXSEvxsu0ahsCmxlVBLWqFmqb+brp3CrQtRSL3zSs2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdegvddgudeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtroer tddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlse hprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeffudelheeghfekfefgfedt hfekuddtvdfhudekgeegheeikefflefhleekheetfeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdig hiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Mar 2023 18:42:09 -0400 (EDT) Date: Thu, 23 Mar 2023 07:42:06 +0900 From: Michael Paquier To: Melanie Plageman Cc: "Drouvot, Bertrand" , Andres Freund , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org Subject: Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry Message-ID: References: <130095b4-7c6d-b6f1-69d4-94f66231f81d@gmail.com> <20230216212121.uvav7xgdh2ysqjy5@awork3.anarazel.de> <621ed53c-4d9a-8f77-ab8c-20235f2d95a1@gmail.com> <9ecfa109-7ef8-26bb-3881-f14741abad66@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0Ol36pndsg0IlV0C" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0Ol36pndsg0IlV0C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Mar 22, 2023 at 02:21:12PM -0400, Melanie Plageman wrote: > Apologies as I know this docs update has already been committed, but > buffers fetched and blocks fetched both feel weird to me. If you have a > cache hit, you don't end up really "fetching" anything at all (since > pgstat_count_buffer_read() is called before ReadBuffer_common() and we > don't know if it is a hit or miss yet). And, I would normally associate > fetching with fetching a block into a buffer. It seems like this counter > is really reflecting the number of buffers acquired or used. Well, it is the number of times we've requested a block read, though it may not actually be a read if the block was in the cache already. > This isn't really the fault of this patch since that member was already > called blocks_fetched. The original documentation of these functions added by 46aa77c refers to "block fetch requests" and "block requests found in cache", so that would not be right either based on your opinion here. If you find "fetch" to be incorrect in this context, here is another idea: - "block read requests" for blocks_fetched(). - "block read requested but actually found in cache" for blocks_hit(). All the system views care only about the difference between both counters to count the number of physical reads really done. -- Michael --0Ol36pndsg0IlV0C Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmQbhD4ACgkQnvQgOdby QH0X+xAAnZkV28mXze3WTToOadZgkpEBjUaVeQ/iXckVdrKsjC/GCJdd4y+rdS3y vspO1h9Wc41+p7+DzrECti9aJ3Ffgt95jfhm5B65C4lXRf6KHgisnK60l8x7n85E TEjdmcEzzMLLYxq3SoOlpfKcTUZi/DckVF7TOnsRPZcI3MOBv3tBtiwk6xYlJ5mq 8xoXh9urYAd3xlSV6cZmErcudLResv6lPaU6H8cjsnQtqdM2G70eto+Cqz/eFiCz 8izEuOdaJwfTSK7k3B5cBZTuBiwISXLNO8YRSf2IxgVvS4W3MsdVMxIwnoI5qZlq RR9S/mj2FqmSTc+XG4ZtNC6AE99w6qNs88KKUS7U9lp5TdwIH8WalcgXONJptZdW WWhlzMDrqDHUeQIEyWNNyBGADOXJbtltlfs7tJRkwCh9vevjbhKDF5oGEU/Cu7xZ KDe0thq4rHdBtmOYq5QvbagwKQLOjAEm5YO3d4t//hSc9LdcmWI6N3+ZWNJ30wmv jJbcoaovFiw1oIPvBdhEHmqEbZ7tAFps9cf2pce7AWyKD3m/HRiKffRbvLZo9U4N iEim6vqDJKzGx4GzxL0Lc7gQxxA1l7W/gZI/sUTDHn1Qj6bymb+p/+7amGuNY+NF nsvrMhsU7p82Vuy9el7ffD7qayVKv/uEfGIe1K0oPAAW/biAyRE= =GhtR -----END PGP SIGNATURE----- --0Ol36pndsg0IlV0C--