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 1tFNZD-00Chut-Ab for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Nov 2024 01:07:07 +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 1tFNZB-00AVRg-TS for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Nov 2024 01:07:05 +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 1tFNZA-00AVRI-7H for pgsql-hackers@lists.postgresql.org; Mon, 25 Nov 2024 01:07:05 +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 1tFNZ6-003g6h-V1 for pgsql-hackers@lists.postgresql.org; Mon, 25 Nov 2024 01:07:03 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id 563D22540160; Sun, 24 Nov 2024 20:06:58 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Sun, 24 Nov 2024 20:06:58 -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=1732496818; x=1732583218; bh=gxno9iwSrb edXcBz+s45C/VdXrDRj9fCocGLuDlyQp8=; b=Rx4AClsHJfyEmn5MKwSrs0Pqtq Adf/Yi9zBLRVsBUA9B/P19EqhPZZUtzFMSy8nNOqI5sTw7bLX8f1VngcSM8nFziH KybGSaPxjKydAGVJGjhZz295Ux6cim0Thu6l3VSImqFzPPBp4XM/48rPwZHSpkGL niSjV6eMyU51gWCngF0rKFMUgqSvsd2uNPs6z4kwiYOF30GNjIzxE5Gkd5HOrBNO eEqBYPL+aa36H9fJOuQRLW+U3rVpBvHSVGO8Y1aLJYzF0O77yMcYiprRyANrpDH2 YeGjH9/Tz3a6AsbVhbNlgRkpbh+4VYHJo/ilnCJgr7NzcCJv+GpGGqLghruw== 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= 1732496818; x=1732583218; bh=gxno9iwSrbedXcBz+s45C/VdXrDRj9fCocG LuDlyQp8=; b=Vs8/o1OMH+YP7367QfViyaTzz9kfRKVwrstqE38Uu40X6IRVJDg eHzKbMVHPNHm0DEYeXrUNv1qHCU35BhWngmyRtae7YKad4Ial1F36N5mv/zXtIHc psSfMLWOlh5B7RL/s3S1vyv8IKHyFK/NlRU7sENN2VLNJCqi6jor/35Y8GTCgko7 omMROQQf9DyZfRdPYGtB41J0AxvdCzVQREjhX0ORsLZSc3fpcFcUoWMQD6UFbwTO m/rU0r1g5QCPPIG1lYpVK8t5rChH8bpCCz80iy3JKVbSlrYzAERjzhzCQCuIvUNz 0k6vH9aZGqlh8WbdNqtUojfp81iTuE6KoBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeeggdeftdcutefuodetggdotefrodftvf 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; Sun, 24 Nov 2024 20:06:55 -0500 (EST) Date: Mon, 25 Nov 2024 10:06:44 +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="rx/1FcJvdCqVxY8N" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --rx/1FcJvdCqVxY8N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 22, 2024 at 07:49:58AM +0000, Bertrand Drouvot wrote: > On Fri, Nov 22, 2024 at 10:36:29AM +0900, Michael Paquier wrote: >> Hmm. created_entry only matters for pgstat_init_function_usage(). >> All the other callers of pgstat_prep_pending_entry() pass a NULL >> value.=20 >=20 > I meant to say all the calls that passe "create" as true in pgstat_get_en= try_ref(). Ah, OK, I think that I see your point here. I am wondering how much this would matter as well for custom stats, but we're not there yet without at least one release out and folks try new things with these APIs and variable-numbered kinds. Allowing pgstat_prep_pending_entry() to return NULL even if "create" is true may be a good thing, at the end, because that's the only way I can see based on the current APIs where we could say "Sorry, but the stats have not been loaded yet, so you cannot try to do anything related to the dshash". =46rom my view having a kind of barrier would be cleaner in the long run, but it's true that it may not be mandatory, as well. pg_stat_io is currently OK to be called because the stats are loaded for auxiliary processes because it uses fixed-numbered stats in shmem. And it means we already have early calls that add stats getting overwritten once the stats are loaded from the on-disk file (Am I getting this part right?). Anyway, do we really require that for the sake of this thread? We know that there's only one of each auxiliary process at a time, and they keep a footprint in pg_stat_io already. So we could just limit outselves to live database backends, WAL senders and autovacuum workers, everything that's not auxiliary and spawned on request? -- Michael --rx/1FcJvdCqVxY8N Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmdDzaQACgkQnvQgOdby QH2x/g//Vd85p6IMlLAf0pgNOJXAXASa7+9m6g7ZFYB1fUIuNiw5UhwOaTGsA4bV 4NmiYI9pNycugfIp/i06ubpcrCudOuNLkeWM7fo6J20YbTTydWniibkfaGqNon0A DhzUS51UKA8E00GjGcPk3/qQeni9s/mOzEnz5EL6Q01KkAFtyu7k6vlW6FZV3Pxv PsxA5S9msWorf3rtjPr9gocv98JznvX1mqapMaIy9Jq4MHwGKwAG4c1mmN0OmVVz U1yVEAKFy6E5yqTJGl7mUN/OJTIkUMiq8T56s3KFVx8Pt5MRvD/zqGa9IbypQ8z5 8Lq3PTk1tp3mMU1U0FDGDFZXTWjYoH0NKsXOG9LO81tmSERE14NKP+pua1iquTGw blyffIJnUoEY1uqa300q/5EMRSuTl5/tg2XeWQ+6VzTf99m5+vVDzI7/BXSuycyx 0ltg0qDfWwqf7Zf7EKmUsrltLYkeBI23wgua2wdSFGZBI1GsAwm4nDlYUro+5B0F RRaNxQlu6y5/DnFlpf59sJUwZ+kuVnXJLWi6qycsAU5+06B9pa6nxUHJ+7MdNkNT 95DW2mnmip3pGlgJtX9mJ5q0jOIdODn/PyIXUI6gHB5CyfGwt55s1aB7w3g8Uv+4 pm78m9ZdveKX0zEnOZ87yUGCyfPgYofkpiCLWeE+ygM/+119ods= =y0c4 -----END PGP SIGNATURE----- --rx/1FcJvdCqVxY8N--