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 1tkblU-005KXr-9M for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 04:32:52 +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 1tkblS-003y9S-Rs for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 04:32:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tkblR-003y9J-LB for pgsql-hackers@lists.postgresql.org; Wed, 19 Feb 2025 04:32:50 +0000 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tkblP-001dxk-2K for pgsql-hackers@lists.postgresql.org; Wed, 19 Feb 2025 04:32:48 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 8905125401AC; Tue, 18 Feb 2025 23:32:46 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 18 Feb 2025 23:32:46 -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=fm3; t=1739939566; x=1740025966; bh=ZB/RtASkyt jrQpcAOf63cJz5bQEvD/LFg8YzV0lUmEU=; b=VJGwtR0Tjqy35ccjn3KRKKUa3Q Gpo1dU0n3C0cQpPjt/BiSIjTKyI5eBndzTuvtF2HFj/KmEeUMGtum2EdZIpXD6eu 46/DmJU0Uuf4k6FaULFP+CkyDUGynfUwHazjKYwP0LQAY1s1ml2nB9KS+eF/8I67 U0rjw1d6AVf23rcfmFFev1NzeTgPCu1QCrUKRQv95SuJX8i3mpimIltBZfZAugm/ dqa8McFePphbNbGj8DSTTMW1kueYdKawgZBsC53z+fI0DNVSmx4jjoRIVvgQmQT8 o+ww0gaxhpXFQ7ZYDZWMaxo028XBY/ba1S6cH/KH7BozVonu6+XPO/e8e90Q== 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=fm3; t= 1739939566; x=1740025966; bh=ZB/RtASkytjrQpcAOf63cJz5bQEvD/LFg8Y zV0lUmEU=; b=u6RHBWBTDIgY/sl+4h0B7v1dxONRuLSAS9ynvKpIXoEBacPW5Uc K+mwpunHdjX/Iwj/CoMdp27yJWVkrZKYcEKRzQmlXtjv1SpgxoNGQOMYZ4fMHmEn zqVKdZTgnIqVEJ7+FMNlDZM2IHN/HhZ9l21UxL4OXp8SH18rZXmx0y+9fWv3RMT7 +A3Lbh1w1njKtmA6Otf3fppJqTfv93hGNdWMGg+vT7xtRu3m4psqNZGMiY+f9vpx hp4vF2wywtnIuF9BrsFukB4Gin1sU5mp+T//iQ0DvA7+iLWl7oxk9NJC7L2hAwtl uOeEm6lD7IPMhpkAP5Kq5pYOrWRdwQv9Fxg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeifedvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculd efhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhep ofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighi iiqeenucggtffrrghtthgvrhhnpeegffejvefgveduvdejtddvtdeijeehudeuledvudef tdfgfeejvdekveekiedvvdenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghh rggvlhesphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepvddpmhhouggvpehsmh htphhouhhtpdhrtghpthhtohepsggvrhhtrhgrnhguughrohhuvhhothdrphhgsehgmhgr ihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrph hoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Feb 2025 23:32:44 -0500 (EST) Date: Wed, 19 Feb 2025 13:32:33 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Remove wal_[sync|write][_time] from pg_stat_wal and track_wal_io_timing Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5yK7D5bjglGSPYzS" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --5yK7D5bjglGSPYzS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 18, 2025 at 10:43:15AM +0000, Bertrand Drouvot wrote: > =3D=3D=3D Remarks As mentioned on a previous thread, I am siding with the removal of these fields. There are more benefits on terms of granularity of this data to encourage users to move away from pg_stat_wal and stick to pg_stat_io. Reasons are posted here: https://www.postgresql.org/message-id/Z7PHiAyt6GI0_Tlt@paquier.xyz > R1. The "bytes" fields differ (as pg_stat_wal.wal_bytes somehow "focus" o= n the wal > records size while the pg_stat_io's unit is the wal_block_size) so we kee= p them > in both places. Yes, I don't think we should drop that anyway. There is no equivalent mapping and pg_stat_wal.bytes is not I/O. This is also useful in the WAL stats for the backends. > R2. track_wal_io_timing becomes useless once those fields are gone > from pg_stat_wal > > R3. PendingWalStats becomes empty, so removes it.=20 Sounds fine to me. The simplifications are in pgstat_wal.c, where we can now depend only on the diffs in the WalUsage, which we rely on for EXPLAIN, VACUUM/ANALYZE and pgss. This makes the implementation of the backend WAL stats much simpler. > =3D=3D=3D Patch structure >=20 > PFA 3 sub patches: >=20 > - 0001: Add details in the pg_stat_io doc about the wal object. That's ba= sically > more or less a copy/paste from the pg_stat_wal fields description that wi= ll be > removed in 0002. As we already track them in pg_stat_io, it's done in a d= edicated > patch. These additions feel unbalanced with the existing contents, and overlap with the follow-up paragraph about the tuning that can be guessed from the contents of pg_stat_io because the new content refers twice to the section "WAL Configuration". Perhaps this could be simpler, with one sentence in the tuning part? I would propose something like: For the WAL object, "fsyncs" and "sync_time" track the sync activity of WAL files via issue_xlog_fsync(). "writes" and "write_time" track the write activity of WAL files via XLogWrite(). See for more information. My point is that the "WAL configuration" section already provides all the details that were in pg_stat_wal removed in 0002 and added in 0001, leading to duplicated contents. > - 0002: Remove wal_[sync|write][_time] from pg_stat_wal, PendingWalStats = and=20 > track_wal_io_timing. That does not make sense to split this work in sub-p= atches > so that all of this in done in 0002. > - 0003: remove the pgstat_prepare_io_time() parameter. Now that track_wal= _io_timing > is gone there is no need for pgstat_prepare_io_time() to get a parameter. 0002 and 0003 can be grouped in the same commit, IMO. - When is enabled, the total + When is enabled, the total amounts of time XLogWrite writes and issue_xlog_fsync syncs WAL data to disk are counte= d as - wal_write_time and wal_sync_time = in - , respectively. + write_time and sync_time in + for the wal object, respectively. Okay to update these are part of 0002 that removes the fields, but there is also an argument about updating that on its own because this is actually the case on HEAD? (No need to post an updated patch for this remark.) The removal with PgStat_PendingWalStats and the GUC gone looks clean as presented. -- Michael --5yK7D5bjglGSPYzS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAme1XuEACgkQnvQgOdby QH29qg/9HQJrARHWc2VgL0VBs8/N7BB+4u7OJXnIpynzbrXwOePDLc6JKqTaS/Aj +F/OVQIEIK4gW+5qV1ar9eiH0b9RzuKahe5dnJIZqV0nZF7zMkxAXqUbDgvgLOep Rbqw1870IxWExRvvoJ88wA7hYOBdWSQYqq5qOelIcq5fA4n/iui2OuaOiZ0KvHJW 70Lu3MGTMtbS6D2GLWa108gVKIhBPNkjmpcEFxVqZxuwLnRAc0Ijk1Fg+Tts8G34 xGh6+abtl4c+oKoVdu8pcnAGVuhrszuTUGTDAYyXcARf3HoyV01mBis1siYzzuWz vH5YDmow8VrsIhG7oAV38+tvI9166q6w6dVGYjwqh4jpiIsY+Uz41EGBqEv6RLZg bn/2kvzT6cFtyNPuhN40NyfLWnP2y1r8ZnVpsyfEw4cVmrpNwkjHhXii5Wv/eg+5 d3EGPYXii6Ou7XzyRGUkf+DgtDENqK/om/zdeg2PcXvoy2sReYw+Bz4tKru/dbM0 AUbFxWXmHifI9c7iV3vD8awvCczobBDSiIshi3u5/ZS9lOBYs0Bt2/i5s5wdH6hY B9ihjYxCZKWyxhR37bR3J26P8fLt3mS/dSE96SkcdQvkk/F3kc8WFI2SZkND0oCj s+CEK0dWUZqMEncehV+syuBKsJIHLHThdqt64oFM90Sy1v8s4f0= =cHXu -----END PGP SIGNATURE----- --5yK7D5bjglGSPYzS--