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 1ph1oL-00071F-Mo for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2023 05:23:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ph1oJ-00087j-LR for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2023 05:23:55 +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 1ph1oI-00087S-8g for pgsql-hackers@lists.postgresql.org; Tue, 28 Mar 2023 05:23:55 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ph1oF-0006V4-9G for pgsql-hackers@lists.postgresql.org; Tue, 28 Mar 2023 05:23:53 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 026F45C01DD; Tue, 28 Mar 2023 01:23:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 28 Mar 2023 01:23:50 -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=1679981029; x=1680067429; bh=pN cSJ49g7PbAlsZZ+zJbfn74TYPQ4Sioo7rAyF9gmoE=; b=DXxJCCFKmf2tMN+pgH KoRnd1NaBU61YywiEVQYW5hpM0+/qDCNCPYrzLAQP6E4RU+capC5Oti3m54wvP0g fjH9SLoW8tw5m5acNTHwofJZeLR1gVDPOnBRPsDlP85TwxN2T1KpWxLtIea/E1a2 XcoKxH0RuMQIQ4jQJB+zNvgsvaEUi6Ws/sewj7hPf7BkBswYF/6hz+1TSWjs1Mbn Brd9w2mRPkvdvDwJS+HjiYrl4CoPFVTYIkpQOfXY/7KbfI58MJ7/r1/Mvi4B72Ir lrv/7AST08+QA4XabxHjf0620Vc/TcsMrMD+p4ybj0OFYPwOeWyNFiKSsQlm7Wbj Jpgg== 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=1679981029; x=1680067429; bh=pNcSJ49g7PbAl sZZ+zJbfn74TYPQ4Sioo7rAyF9gmoE=; b=PD2MCOMBrVyYxDtPtL6tlLPmQvYIV z7THXdEYd7FvTNtitp1VoR/jnmFr2gjiKXKQPjGub9zNbjR/IcFjrSnTd+gZCE30 VkQVz0FObS5YVBkc9dMG30B4jj5lq06EKcRZYT8icd8ZFcoCGivz8RPqQOaOw+5e 4q4h+MrBlHXxLO+ZyuAYx/bMFndDl9hdEUuxLTqVDMU+PMGwVxJy5vhQuPJxT1C9 jnEd8Vi07m8v7QCl4JLCJM3K6oRClUvMYTTUC1sgoTiWkScGoaqahqWOqs9e6vpG UUZ9e1cJBfhAtguIP03VtKNhFTgkNURD1wbirkEav+STTehh4r8vcHBQA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehfedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Mar 2023 01:23:47 -0400 (EDT) Date: Tue, 28 Mar 2023 14:23:43 +0900 From: Michael Paquier To: Kyotaro Horiguchi Cc: melanieplageman@gmail.com, bertranddrouvot.pg@gmail.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org Subject: Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry Message-ID: References: <20230328.123615.1049160234680207474.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GpSvVXjk45dHiTyS" Content-Disposition: inline In-Reply-To: <20230328.123615.1049160234680207474.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --GpSvVXjk45dHiTyS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 28, 2023 at 12:36:15PM +0900, Kyotaro Horiguchi wrote: > I found that commit ddfc2d9a37 removed the descriptions for > pg_stat_get_blocks_fetched and pg_stat_get_blocks_hit. Right before > that commit, monitoring.sgml had these lines: >=20 > - pg_stat_get_blocks_fetched minus > - pg_stat_get_blocks_hit gives the number of ker= nel > - read() calls issued for the table, index, or > - database; the number of actual physical reads is usually > - lower due to kernel-level buffering. The *_blks_read > - statistics columns use this subtraction, i.e., fetched minus hit. >=20 > The commit then added the following sentence to the description for > pg_statio_all_tables.heap_blks_read. > > Later, in 5f2b089387 it twas revised as: > + Number of disk blocks read in this database Yeah, maybe adding something like that at the bottom of the table for stat functions, telling that the difference is the number of read() calls, may help. Perhaps also adding a mention that these are used in none of the existing system views.. > The confusion stems from the inconsistency between the views and > underlying functions related to block reads and hits. If we add > descriptions for the two functions, we should also explain their > relationship. Otherwise, it might be better to add the functions > pg_stat_*_blocks_read() instead. I am not sure that we really need to get down to that as this holds the same meaning as the current system views showing read as the difference between fetched and hit. -- Michael --GpSvVXjk45dHiTyS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmQied8ACgkQnvQgOdby QH2BTxAAh/JvQ04aiokiyobHQOc3Dd3ztprRLTTMBl3Mp3P+finnNFvWW/laE5dz M/pEs74THeWvgqq2h681vcZGEZal9I15w5zW33/KQeFTJu7Mtw2RWibjf91v3APn 3lePH4kDshpHLAzVQrUCJ8mFvF/brMCIrNdZn6rhEBrisMqstbeUZTWqCiBUEa1b S4fSmIB/Gm/gIULis3ogaCNZ9q8k8kUwO72ZgZBUKeckS0q+Wv7HPuyAPKHfd/Ux jdn1D/NX8dLANLHuy3s5b8XZ7v3Xs4fGag6nRshKYsUQ/BqXi5/ABw6QIOAD+Li4 aF0n5wvKvJwgeiKqc9f56rDnQTXDr6S7br22SPayu4szQ5faTVwx5QXEnFOxeLv5 86WDmiX7chrXe0L+6ao0bGNve2crUnlzKvKrFLvhs+ubZ+pAWLEfzEOjy+1KOEuv lGGeJMTtCPCsoUqCctEyk3QvWm2LhUYaXMzJCLu7dFjHtV4KuIzPtaEXByfeEX73 rE4xqe6gK5ErqXFtAFtkrJcDMAl9EOBiVLsjN/81zqHPDxYhiry5pHrAaRnd+7JE q03LdG/+X7vqS7Kr+bD0Wsb09VlrcGQHCf9C5xneXwmJf4+Hn7mXjo0s4rwklr9D SQRlJXWazZNRGKKY6fXT8JzUWBmmvxY+2RnPEfjm2VjPIcalcdo= =8HYs -----END PGP SIGNATURE----- --GpSvVXjk45dHiTyS--