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.96) (envelope-from ) id 1w5xRI-003ni3-2L for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 03:00:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5xQH-0077fa-2f for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 02:59:46 +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.96) (envelope-from ) id 1w5xQG-0077fS-3B for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 02:59:45 +0000 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5xQD-00000001Oy7-36NM for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 02:59:44 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id A40957A028A; Thu, 26 Mar 2026 22:59:39 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Thu, 26 Mar 2026 22:59:39 -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:subject :subject:to:to; s=fm1; t=1774580379; x=1774666779; bh=HrYNl+XJ5A KmxpkwikuRpjdpx1LDdusrK2rOl0nsFlg=; b=yeqI1ZvzTDgb8Xn6wbeiZLpuQa O3srGYwnPXwo7mGDiZh8Z43ZWxWBoBPtfu8EA8JqjTDk8pe5YYgOsZcQBr6nv/P3 MUwybInRHkzSxWcbSz4D71snfRXhzmZiNl0CHXanxBdPJzzpINCQViklvZ4I/Bhb 52Xr4PvyLlAMqs+sQKdVQ1g4CF3GDqvxIAKXPfqfCP76jwTBKfKjvEFwAk22nd19 wPORUUJV/M7lnEhuonzaGaIX97KtuGffmvl/7Ghg5j4Li/2oXuvk4iqnFgG6Ta8C 6aohxBAlBYQbprTY1qMr7et0SwRbXN8C2Ra9WutYtuB6//eJWGuBbOvE6QGg== 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= 1774580379; x=1774666779; bh=HrYNl+XJ5AKmxpkwikuRpjdpx1LDdusrK2r Ol0nsFlg=; b=j1Y6eGeg+KSybgtEPi31+kLK5zY4VXVT2C9R/chIFLbrVKyWVkT PBOWMrsNRgjqMiz6qNGFo6LHuE8ulkn838qY5wM0iDH9lbB5gopyQa9x7ALkRu5A 9ztK6kZjOIQ+fRW5StiLfAcLwyUctCSIMg9adoIfr80Wo1ySS6w71S8rNOhTq2Da Oajk44nO/WBSSN3/9hOG+dWEVs8HFxAorsXWwG3xnDeHMmdmTr1MkHYdeEUshoVM Wf41+U3m6df0SuS1Gb3za4Tm8e86HvoYzyVhVJUkeWs0mGYUWAQ4gwhsGgaj/svw gKQSMfz5660XYihPzgt4dmmV6yZ+mggFf2g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdeludegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgrth ihrghnrghrlhgrphhurhgrmhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhl qdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Mar 2026 22:59:37 -0400 (EDT) Date: Fri, 27 Mar 2026 11:59:33 +0900 From: Michael Paquier To: SATYANARAYANA NARLAPURAM Cc: PostgreSQL Hackers Subject: Re: [Proposal] =?utf-8?B?cGdfc3RhdF93YWxf?= =?utf-8?B?cmVjb3JkcyDigJM=?= per-record-type WAL generation statistics Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bv2ThYkD1lLrmxwW" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --bv2ThYkD1lLrmxwW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 26, 2026 at 05:29:25PM -0700, SATYANARAYANA NARLAPURAM wrote: > Postgre already has pg_stat_wal for aggregate WAL volume (bytes, full-page > images, buffers), and pg_walinspect (superuser access required) for > post-hoc forensic analysis of individual WAL segments. But I don't see a > lightweight, observability tool that answers in real time which record > types are responsible for the WAL. Additionally, pg_walinspect runs again= st > on-disk WAL files, which is expensive. This view will be useful for > monitoring systems to poll cheaply. >=20 > *Use cases:* > WAL volume investigation: see which record types dominate WAL generation = in > real time without touching disk. > Monitoring integration: Prometheus/Grafana can poll the view to track WAL > composition over time and alert on anomalies. > Replication tuning: identify whether WAL volume is dominated by data > changes, index maintenance, FPIs, or vacuum activity to guide tuning. > Extension debugging: custom WAL resource managers get visibility > automatically. Why is it useful to have access to this information in live for monitoring purposes, divided by RMGR? What do you define as an anomaly in this context and what can be changed on the server side to get out of an anomaly, based on the definition you would give to it? The current WAL and IO stats are directly useful because they provide numbers about flush, read and write quantity and timings. These are useful metrics for benchmarking. This proposal only informs about the number of records, and we have a various number of record types that have a variable length, that can influence the distribution of the data written on disk. As a whole, I am doubtful that this information is worth counting in live, eating a stats kind ID. One could also implement a background worker that provides more advanced aggregate stats outside the WAL insert path, with a custom stats kind. No need to have that into core, especially if the code that increments the stats eats more and more cycles. -- Michael --bv2ThYkD1lLrmxwW Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnF8pUACgkQnvQgOdby QH0qxw/+MtVJiu8qc94GB7SIAm1e96EGW/IUPz8fzVJORBNKTPWGA4tD6kueV2hR ZQBq8Gzep/VrOCimJveID2DsmV1JsFToAdChF4BiAtZ+hSbAD5zwN8Z56tA8/+3M ieeG/EM5aFk+TYzWXTR4fLHnXtCfKXlHKR1vqH8QNIZZsq5e3Z6IxGEs+uHVeFgc XjjoXh8vVOiD74Oo1xd0C/jhdIAcyUwITGUoI5+hLhqsBVpPtT4puutPhzi7E2XH qczOZ0f8kMXFtgQEhPmm4HA4X9TSOEDtTXuK5drTT971YFawUF5sZF+pRjnBkoRX RNBv0GHMz+vVi99zS+6qASjZKtdRsKUFFypA/GznTXKpGLA7CNjZ2lN735BlC66N 2YeHqokxOrC0zvF0VGYrxc44vpjkCzFuJxgVh/iRRImzeKbCcpuqLlYHy+9YgGuQ MnojdUj17KYO6umMOpZ7D2BUTNzCzsG8ri8TWPXcy5YfLB746fBgGdGltUfaTeJ2 Li9W9c8E0P9Itop6XDqtZO4LOPfKSfxlcPo3lp4wnCTOHPKJtcsKfLuMs91gB1HF 2ztPVHrz4p3eIPdeMV87cpwExrJ+G/tw/KDAohTAHMKNyjb1Gu9Y+OSl9BNSwV8m 5FyYqFomEuFD0wfNPIw7CRSSHUWlMwje+kobNxJZySNFrvfLYkA= =q+RZ -----END PGP SIGNATURE----- --bv2ThYkD1lLrmxwW--