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 1w5EjJ-0032gF-1e for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 03:16:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5EjH-00B6aq-37 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 03:16:24 +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 1w5EjH-00B6ah-1G for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 03:16:24 +0000 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5EjE-00000000zXw-2VY8 for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 03:16:23 +0000 Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id 64028EC0197; Tue, 24 Mar 2026 23:16:19 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Tue, 24 Mar 2026 23:16:19 -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=1774408579; x=1774494979; bh=dg9jzHHQhQ k/G+AMwEdW08Rli+Lr3uFSzvDyVlNfvVI=; b=tEN/y7SUS36CFcfVoDfntVS8MA 3glEHsUB6xAioUYHAlIc2wz+2Uh2ZvhRzf2BqZZdhxLP9JMfXLKytIjDcC++ljzs 0kZuBbRPK7QS3Rk9Vy5LGLy1ZVQndWYP+oHIT3Is1dieUXXSGmNg5nZxs4k13Fk+ 5MwHhekrqAau2UQGIOuhC5eXWouUHTX3HWuOOvMmxYk/5sKH5GTDfuDG4Oc7iLpF /aDpvL3Ar4AvbAZUFVSsWAcF+S6XSjaLeSqDdzIkduayA2KCBNsZ7E4aqyAv05oN xh2d52CDKR8+Wo9PVeLQNDXS6gIksRUbpcNGxTz42CTyO+9aLpJL2EeK6IfQ== 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= 1774408579; x=1774494979; bh=dg9jzHHQhQk/G+AMwEdW08Rli+Lr3uFSzvD yVlNfvVI=; b=bMNJoO1ASoEnkp+/XL7WLySr9+UmHuZ9SJr7XbpKMMcVk6MZEeT yffT6CrCdCrW+mfE50WIFzbNPm/lTUIePGXfuKJMbciiAzlXxfdoDe3ru3diQ2bq SWMPZrKyICQGnxGXp68Dj4fYm7/C9GmjScBiJbULF0KulA+suR8pJnQgBMU8eOWf mUfBQPGrLbg9zfydYuthnK6Yf+sxf6G2qKgJp4kET85G3GcxwE7QKZvFdsiTqLW1 AAtmtxJ5u/orQGcOx/CyfdglWV/1XwhRnijUqXncSkKcTyP3JL1w2Bjus8pd3uc1 CiWcueOU+52xmUEDMSWabQ/l7iO0xV6xG4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdeffeehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgrmh himhhsvghihhesghhmrghilhdrtghomhdprhgtphhtthhopegsvghrthhrrghnuggurhho uhhvohhtrdhpghesghhmrghilhdrtghomhdprhgtphhtthhopehmrghsrghordhfuhhjih hisehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhi shhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepiihsohhlthdrphgrrh hrrghgihesphgvrhgtohhnrgdrtghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Mar 2026 23:16:17 -0400 (EDT) Date: Wed, 25 Mar 2026 12:16:12 +0900 From: Michael Paquier To: Sami Imseih Cc: Bertrand Drouvot , Fujii Masao , pgsql-hackers@lists.postgresql.org, Zsolt Parragi Subject: Re: Flush some statistics within running transactions Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="URaJ+n8gRt1tPalr" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --URaJ+n8gRt1tPalr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 16, 2026 at 06:42:44PM -0500, Sami Imseih wrote: > So attached is a new proposal with tests and docs. In terms of > test I fell back to the strategy used by Bertrand [0] with the As far as I am reading the patch, it seems to me that this would accelerate the frequency of the stats flushes when we have a transaction with many short queries, but it does not help much in the case of an analytical single query because the flush of the stats would just happen once after the timeout set for each query? Let's imagine for example a query that takes hours to run, where we'd want to get fresh IO and WAL stats (backend included) on a periodic basis by processing interrupts while going through the executor. Thinking more about this problem, I'd really like to think that a client-side API would provide a more flexible interface for the analytical case. -- Michael --URaJ+n8gRt1tPalr Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnDU3wACgkQnvQgOdby QH3FdhAAirK5JiLZJi/8Apy0RkumkaRw2tEF7cpNsZbXDhxYg4tNQc2YlqniOV/4 VBkOEfHR/VwyjCYu3YB7fIljUA4byvmcToIrC+3EKftGGg6xKzaLgN9r6ZQ30Fxx WcOgZ8AjxoywgG12ZeP+pGuqFMrIyb2iA6o4vOcNvelGb+DnLOYf47pkMQGPqyf+ GlD9/86Wvg6dvVs1rV1sXIOmjnC6FjwGeU4yVDq3eR9cOsqn9y/FYkAsTqujVWDz uSVlernP3gTMHnsHO6Y3gRTe//L/jbuJhioj1OURx5LosaW2gS9AXyQRKrTRD0PW B6JYWuYxWm9rab41oJsAvMl2vVC1y6vhIkVEIIRwZ5lqq91L0mAMTGlvXtFenbAT EVa8F5SW9VKcjo+1AcnWDAIRgwu+9CiVJEOFdi9JwGPYoqi9c5Rlv9Z+/WVIJeZ8 aTLhZ9IBLee0sL9s5qyv7fxFgpbWCr0z3Fw+OpG2SLm4DSes3pfSckFMAAJxyJ9Y RLkyGW+xSFGczhyCa/ozbSIyFFXnlnQs3TU8NhEZ5ZIpfSxJz3eiaDN8AtU9WA7U PXZP+5zvCWS+sYFqoYecHJ06+7uQhxF0EJgkgRfyg1Qd7okHKxEk942qiWXPwOe1 JPh9YranoHqdMO1Ix89evJjbOx/Zfk+LYIIH/0FOQzh9s18yfps= =QiZW -----END PGP SIGNATURE----- --URaJ+n8gRt1tPalr--