Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGBd1-001PQw-19 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Nov 2024 06:34:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tGBcz-00CODy-45 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Nov 2024 06:34:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGBcy-00CODp-Q1 for pgsql-hackers@lists.postgresql.org; Wed, 27 Nov 2024 06:34:20 +0000 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGBct-004HDc-9m for pgsql-hackers@lists.postgresql.org; Wed, 27 Nov 2024 06:34:19 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id AAB172540147; Wed, 27 Nov 2024 01:34:12 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Wed, 27 Nov 2024 01:34:12 -0500 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:subject :subject:to:to; s=fm1; t=1732689252; x=1732775652; bh=KtoxDiEBhp tCN2KVk/n+h/OQZUn6wTaq1T1oZ68C/YA=; b=FnwDqS2pWL73QreHe/GeLXr0ZQ ZdmnM4VDJLyVEQT+M2vyzfgIwv1xQmWkblE25+iEOFJtXAHFZ7wu8QrMe0FZ7TFy 1G9fdl6C4ikE9BKxE8aBwbn+x/3V78Q1ilfI3szFvBjt186kSf7hLJqD2MD4twa1 McAASjqSszh4BLE0O52Q6OPLLw4B084h7MUFSPztAr8zMlzfKZr6xPeUos3d/JjR CcYG2FAIQAtKwAoxjDWQjJzy4g4GXjLBsEF2pm3biLUHMFr/DHrQnEeNKl2ISP7m Ni5NnFRSvwx76dQ1fM8i9KDHNJymrglghOXrzosAg/BjhRTbrZxyMagXT4ew== 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:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1732689252; x=1732775652; bh=KtoxDiEBhptCN2KVk/n+h/OQZUn6wTaq1T1 oZ68C/YA=; b=Tx3cjjeEIWujvCZieW6cCa+q917gs3sy+EwgJ5zPoOJFY9KCozf pmYC/GfkFtKJuFgsk45iG9jszg/9SAJb68rhblJ96e7hGsgEU+1YoiEEFvSe//LG 3VlrK1DMeHrlvyNc/rC64Mk/BoS7r4UbOKOKcUSO4Ep2RLxW5QJ0QhwF/tbrFGbU yFU6LFPADF4+d1+CfnbMCLkB3w1dIDeu0SoPvFbFGH/oBzyP1E3ck7/+2PHomSkV bGmL03gQUPoY4EAtyrHzXnC1Km7Ac0SAqNT0h36AfHxBzDeP/pZL8g31L+AHu2VS /k3KJA4gdRC/u/+orA7UMjaBgzDKlvs7E9w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeekgdelhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhgg tggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoe hmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleei fedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehp rghquhhivghrrdighiiipdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopegsvghrthhrrghnuggurhhouhhvohhtrdhpghesghhmrghilhdrtgho mhdprhgtphhtthhopegshigrvhhuiiekudesghhmrghilhdrtghomhdprhgtphhtthhope grlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhrtghpthhtohephhhorhhi khihohhtrgdrnhhtthesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrg gtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 27 Nov 2024 01:34:09 -0500 (EST) Date: Wed, 27 Nov 2024 15:33:38 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: Nazir Bilal Yavuz , Alvaro Herrera , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org Subject: Re: per backend I/O statistics Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7bUVhIOXHW/mro9i" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --7bUVhIOXHW/mro9i Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 25, 2024 at 03:47:59PM +0000, Bertrand Drouvot wrote: > It also takes care of most of the comments that you have made in [1], mea= ning > that it: >=20 > - removes the backend type from PgStat_Backend and look for the backend t= ype > at "display" time. > - creates PgStat_BackendPendingIO and PgStat_PendingIO now refers to it (= I=20 > used PgStat_BackendPendingIO and not PgStat_BackendPending because this i= s what > it is after all). > - adds the missing comment related to the PID in the doc. > - merges 0004 with 0001 (so that pg_stat_get_backend_io() is now part of = 0001). > - creates its own pgstat_backend.c file. I have begun studying the patch, and I have one question. +void +pgstat_create_backend_stat(ProcNumber procnum) [...] + /* Create the per-backend statistics entry */ + if (pgstat_tracks_per_backend_bktype(MyBackendType)) + pgstat_create_backend_stat(MyProcNumber); Perhaps that's a very stupid question, but I was looking at this part of the patch, and wondered why we don't use init_backend_cb? I vaguely recalled that MyProcNumber and MyBackendType would be set before we go through the pgstat initialization step. MyDatabaseId is filled after the pgstat initialization, but we don't care about this information for such backend stats. -- Michael --7bUVhIOXHW/mro9i Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmdGvUIACgkQnvQgOdby QH2CqBAAj6Vo0XaL9DNsBBbqS/wn3P1Mir/NrmZ7Cz7k/AsMu3ptAkRAG+sLSf39 FT8iT3ZDMdDEeeYdlbTCs1+JZ+JBQ35HK8zIr82VGvZKJtb8LwJKy64TKF0Aiooq BLjZReA+UaFnsSfJVVAKheMw6d2VOuElmbsGfPJmqSI9d5KMCa8a7TVq/COnBXHs BO7vsMVrr9SozTUkiY8mwKIqs2D6E3cpCxJoPvtsJFSRhhxlntcQFEtsupff5dZp GfqS6A9WRyVQLAsv/8J/A8L+JG0Jml9XQtFNwCJrNCS4CLkpknROtmcWf0IIzKI7 25V6W42FoaD9wCK+VfQVlqNfCfYr4jX0eTfftbahyOlWvM+B2X0uxCXC6lYooxdO jCGU+4Tnq4LUVbmeXwUOwzNFbNrbp2W1Ur7icIIRSrEtpofRqDxs2KA5c7Axp1Nt fZCT+ODdBOGQsiN/z4OOEP3QXl4gF72huqhlF3KC8NeJm2n9ZXyHqr38kw0wpKLq U0EkIfZCDA62ZGvPeXVLdUlTMbGnt+rJgIJcin5BqkpqaYydcBFmf3wmynqQ28jp OFeYJhXiQkPYFbGHAatMrRUYLbOQIu9ebGyGI4rL8JL6MmHTKFp5DyhtxspRjL1A Zoyqtoxm6DM8mlU29Tu1pFp1qfEfvxTnKhMlSbiZPylFxBebaKU= =yJQC -----END PGP SIGNATURE----- --7bUVhIOXHW/mro9i--