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 1vikQk-00EQ5j-2f for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jan 2026 02:28:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vikQi-00AUvr-1h for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jan 2026 02:28:16 +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 1vikQi-00AUvi-05 for pgsql-hackers@lists.postgresql.org; Thu, 22 Jan 2026 02:28:16 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vikQg-001p97-01 for pgsql-hackers@lists.postgresql.org; Thu, 22 Jan 2026 02:28:16 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 89ABB7A00F1; Wed, 21 Jan 2026 21:28:12 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 21 Jan 2026 21:28: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=fm2; t=1769048892; x=1769135292; bh=H/Il+y1PaE 9dN//BPzzWy+xBOAeVUbgTMwaCxYUn8ZU=; b=FqgauRbRaYXVYyB4/2EDPPaj1R BEApWWAbPeyiZRZCd80BbBfKGjrWFVT2FjQfqrsGFbiV4bUsuJtRoU2mM5ArNei5 wjQH0W19jq1xkNifXvtGlJvYeLkZvLoT2G7Gf4qrbAcKyhNbUHn+RM5yIwpMkWg0 IO/nTHIB1EKVlhFcftU8/Dy6QwPWxRbABfld6sQuOqEM15wf9QYlqUxe8K/D9c8F RFWjVlPZ4+QDnvyLnkRTKioR7KjKvoPkOFcJbQzmq9J7arTjyklOI4k5vWEXn2l6 jKSOlvbymbqpKkp3imHx+UG499FAw1Mmfdc06Hf3XDV5Jf7RMwC0jf0io+Dg== 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=fm2; t= 1769048892; x=1769135292; bh=H/Il+y1PaE9dN//BPzzWy+xBOAeVUbgTMwa CxYUn8ZU=; b=n0x97CFgLpBYRBjFh25PtILEDFjq3X7yJMEixo6pFvJ9oAsyOP6 YrlOZ/YuT6B2KZ4tC1d4MYIlGxcclvtTVLo87U6iv+/ZxKCaO3B9QIP8DRjgexvb i7E2GQAZhg8VF4U5Hl0vLlxVe3Qeuldb4VxpS42KjgCqGnSsipMAqF+Zwefr5hSr tzTgT5MHxG2WvP58KSScyjN76b8FWykEiOvE1TSkay22LOHBeoZ0bj5KI2GqQ4wu 2LtJo7DqoNuSxVuiFRDTZ5iCVePSlgecqRbA+F1Xbd2cxS2MPUeDYoYLNP/f1SF5 DLY9uNTuqVWkbC/j/Au9tUPXOaxcTmXi/+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeegleeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgrmh himhhsvghihhesghhmrghilhdrtghomhdprhgtphhtthhopegsvghrthhrrghnuggurhho uhhvohhtrdhpghesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkh gvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopeiishho lhhtrdhprghrrhgrghhisehpvghrtghonhgrrdgtohhm X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Jan 2026 21:28:10 -0500 (EST) Date: Thu, 22 Jan 2026 11:28:06 +0900 From: Michael Paquier To: Sami Imseih Cc: Bertrand Drouvot , 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="v3iVp1sy9Le3/nxx" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --v3iVp1sy9Le3/nxx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 21, 2026 at 07:41:30PM -0600, Sami Imseih wrote: > Another one would be n_mod_since_analyze, That should > only be updated after commit (or not after rollback). Otherwise, > it may throw autovanalyze threshold calculations way off. Same > for n_dead_tup and autovacuum. Point taken. It sounds like it is going to be super important to document in the patch these kind of current expectations, so as one does not flip the flush mode one way or another incorrectly, or assigns an incorrect flush mode when adding a new stats kind. It's probably worth documenting that the end-of-transaction flush should be the default norm, while the out-of-transaction case should be an exception one needs to be careful of. > Sure, Bertrand mentioned early in the thread that the anytime flushes > could be made configurable. Perhaps that is a good idea where we can > default with something large like 10s intervals for anytime flushes, but allow > the user to configure a more frequent flushes ( although I would think > that 1 sec is the minimum we should allow ). Sure, I am just mentioning that we should not be that aggressive for everybody. If this can be made configurable on a call-basis, even if it means a new GUC, that may be better in the long run. -- Michael --v3iVp1sy9Le3/nxx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmlxizYACgkQnvQgOdby QH1KlQ/9Fn+2SdKbaexVgprmTOA5q+06b/EtKz4xZ4h1/N9j0x+VQap10emqLqRR o5Itr0H8MdJrWlfRXkP3gjUReigVZqZaAndJvFELO50V6gskiwsX+k+3ONZTo0d/ Nhl4BOkmJjSk7Q6jZgCgnAWofJ9aeielSEapu7cVhQXtCqG5EywRdMeX9JdHrIq9 cTZoyVN5vzYWJ3TEjbz5qA0/nOuVoU2edeyk/fqng1AkVkT0jzsJBCwsGbpBCP24 nNlXPURudeYjlWj6EYbWZ/ysII/XDIeopSA66Lm1twjcfeQyo33YqvEjczVDsSlz aAbuNnVjW4ncygWBYTq4kLTSGttQMTDWKsXn7CWNlbKA+Tlw6X7HgshetGlXcsMZ oDJgpgr7uJwGN0sXM/A6vKxwjLInI+kle6S83dphe5jdh1FbBu6KLwHaQ/jdj4AC IwP/lY8UrwgqYLHgbt6UdWVpYgO3ZA2jgoPc9p1uRyeb34nGQIrfNKuR0EDerPEZ cjPtfYgKXf8NhE58UjkWZ882lUi6ZgpkD/orOWHtoPXmuB3u4QvEB54F1c54HUE4 WQs8wXS3rMOuNe8nc38FY/ph+XtAXFOZzHPteay3GjI+xQHXMJSMpLSBdn5DM5vb LOCHP0+yxqsx5KshuXABQ+VC96Zoon5v5+Jt3eQNwt3o1CdbrPM= =uIiP -----END PGP SIGNATURE----- --v3iVp1sy9Le3/nxx--