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 1wE8UV-003i4H-2v for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Apr 2026 16:25:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wE8UV-00DIJY-0H for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Apr 2026 16:25:55 +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.96) (envelope-from ) id 1wE8UT-00DIJN-38 for pgsql-hackers@lists.postgresql.org; Sat, 18 Apr 2026 16:25:54 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wE8UR-00000001e2x-1mBJ for pgsql-hackers@lists.postgresql.org; Sat, 18 Apr 2026 16:25:53 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 6427B1400082; Sat, 18 Apr 2026 12:25:50 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Sat, 18 Apr 2026 12:25:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding: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=1776529550; x=1776615950; bh=P5H3p1FS6X5jax/RzL2gDFN82NVV/JIfDiflMyycnvY=; b= Wn8ELXvu8FSqpnArWiPSl5Lb269+lAz87NU8HQwUM7AGfmQ8RSikPcfdcnRPp/jG WuR1ppImcEnyxcrsIKbhXiMveZdpGnxsRfgLz/0WRkLk+IWI17frRvonch+/gZpu IesqRmIgDWG3KRBvBo3wH4Qis+cs8qpwhB+knr++Z1h5KNjvWC0Iha9vbbrRi2f3 wiknCWk4a7zJfvZoVNrzUcEXptR5xhVq01yM/TX5v0wx9oBTnmNVpjnkFdCvTrVk jQ1c19z+otY9mxC8+Jf9TBN/Mx8iEChwhOtGu0Ve71Y6vXvmBCEVWzhUjXiys9/8 D1U9J06zqMeLGIfWgDEZJA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1776529550; x= 1776615950; bh=P5H3p1FS6X5jax/RzL2gDFN82NVV/JIfDiflMyycnvY=; b=W C1yZgiEyBzqgaLxuRseD0YUQDwlLfAaV3Q09xwA5VR/ru18xoXiIHcvcVLrMEMPn 4lywmPguGEuxtfmx1/fCYW+aeaZ127p3hEWyr7gzgod+/d/I2vs394NqKOmnOuIB PFP7mzn8sPMRTWAK2HwUGgF7QRuugeudEB03ZeMK5fSAnGo52V+UwzgP3Bd1Pvt/ +jpMAmIwhJCjyET2UihR3RgXIuj5dVO8pW0QsnW2pTJ0G7Kp/X18KXIAhMfB9qTp mgPfNh0q4i7jYzFfUV2Q8qlqaexwxs0ADMcwOU8XuRWdrDYTc+dajb/oD5ZOLUgx rOvhtZp5rkenXscOFa6TQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdehfedvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtugfgjgestheksfdttddtudenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepjedvueevuddtkeffgfevudfhkeeujeejtddtkeetleefvdeiueetheelgfei feffnecuffhomhgrihhnpehpghhsqhhlrdgsuhhilhgunecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdr uggvpdhnsggprhgtphhtthhopeduuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epughgrhhofihlvgihmhhlsehgmhgrihhlrdgtohhmpdhrtghpthhtohepvgigtghluhhs ihhonhesghhmrghilhdrtghomhdprhgtphhtthhopehlihdrvghvrghnrdgthhgrohesgh hmrghilhdrtghomhdprhgtphhtthhopehmvghlrghnihgvphhlrghgvghmrghnsehgmhgr ihhlrdgtohhmpdhrtghpthhtoheprhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtoh hmpdhrtghpthhtoheprhhosggvrhhtmhhhrggrshesghhmrghilhdrtghomhdprhgtphht thhopeiguhhnvghnghiihhhouhesghhmrghilhdrtghomhdprhgtphhtthhopehhlhhinh hnrghkrgesihhkihdrfhhipdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhi shhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 18 Apr 2026 12:25:49 -0400 (EDT) Date: Sat, 18 Apr 2026 12:25:48 -0400 From: Andres Freund To: Alexander Lakhin Cc: Melanie Plageman , Tomas Vondra , David Rowley , Kirill Reshke , Chao Li , Andrey Borodin , Xuneng Zhou , Robert Haas , PostgreSQL Hackers , Heikki Linnakangas Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) Message-ID: References: <2be31f17-5405-4de9-8d73-90ebc322f7d8@vondra.me> <97529f5a-ec10-46b1-ab50-4653126c6889@gmail.com> <46733d68-aec0-4d09-8120-4c66b87047a4@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <46733d68-aec0-4d09-8120-4c66b87047a4@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-18 18:00:00 +0300, Alexander Lakhin wrote: > Hello Melanie and Andres, > > 03.04.2026 08:00, Alexander Lakhin wrote: > > > > 31.03.2026 19:19, Melanie Plageman wrote: > > > Thanks for the reply! I have committed the patches in this thread and > > > marked the CF entry accordingly. > > > > I've come across an interesting failure produced starting from 378a21618: > > ... > > I've discovered one more behaviour change introduced in 378a21618. I > investigated a yesterday's skink failure [1]: > # --- /home/bf/bf-build/skink-master/HEAD/pgsql/contrib/btree_gist/expected/enum.out 2025-06-23 20:17:56.295775456 +0200 > # +++ /home/bf/bf-build/skink-master/HEAD/pgsql.build/testrun/btree_gist/regress/results/enum.out > 2026-04-17 22:35:37.212061309 +0200 > # @@ -83,12 +83,10 @@ > # > #  EXPLAIN (COSTS OFF) > #  SELECT count(*) FROM enumtmp WHERE a >= 'g'::rainbow; Random: I wonder if the author if this intended this to be a temp table, based on the name? That'd prevent any concurrent autovacuums/analyzes from changing anything. > # --- /home/vagrant/postgres/contrib/btree_gist/expected/enum.out 2026-04-18 11:41:17.224063241 +0000 > # +++ /home/vagrant/postgres/contrib/btree_gist/results/enum.out 2026-04-18 11:52:43.870049782 +0000 > # @@ -91,18 +91,16 @@ > #  where c.relname in ('enumtmp', 'enumidx'); > #   relname | relpages | reltuples | autovacuum_count | autoanalyze_count > # ---------+----------+-----------+------------------+------------------- > # - enumtmp |        3 |       595 |                0 |                 0 > # + enumtmp |        3 |       595 |                0 |                 1 > #   enumidx |        4 |       595 | | > #  (2 rows) > # > #  EXPLAIN (COSTS OFF) > #  SELECT count(*) FROM enumtmp WHERE a >= 'g'::rainbow; > # -                  QUERY PLAN > # ------------------------------------------------ > # +                   QUERY PLAN > # +------------------------------------------------ > #   Aggregate > # -   ->  Bitmap Heap Scan on enumtmp > # -         Recheck Cond: (a >= 'g'::rainbow) > # -         ->  Bitmap Index Scan on enumidx > # -               Index Cond: (a >= 'g'::rainbow) > # -(5 rows) > # +   ->  Index Only Scan using enumidx on enumtmp > # +         Index Cond: (a >= 'g'::rainbow) > # +(3 rows) > # > not ok 48    - enum                                    10596 ms The interesting column to show here would presumably be relallvisible. What I assume is happening is that occasionally analyze now sees enough all visible pages (due to on-access pruning marking the pages all visible) to consider the index only scan worthwhile, whereas before that wasn't (or only very rarely) happened. Maybe I'm daft, but what would prevent this from happening before? The path for it would be a bit more complicated, you'd have to have an autovacuum instead of just an analyze - but that seems possible. It might require running against a pre-existing install to be likely enough. > It's not reproduced at 378a21618~1, though. > > Could you please look if this can be fixed? When you say fix, I assume you mean address the test instability, rather than actual code changes? Greetings, Andres Freund