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 1vGHva-00BgfP-SB for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2025 14:22:30 +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 1vGHvZ-00ECx8-QJ for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2025 14:22:28 +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 1vGHvZ-00ECx0-8M for pgsql-hackers@lists.postgresql.org; Tue, 04 Nov 2025 14:22:28 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vGHvW-005Pmi-1R for pgsql-hackers@lists.postgresql.org; Tue, 04 Nov 2025 14:22:27 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id B84F01400204; Tue, 4 Nov 2025 09:22:25 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 04 Nov 2025 09:22:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.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 :reply-to:subject:subject:to:to; s=fm1; t=1762266145; x= 1762352545; bh=qU812l4jocjIDwvg2vs463dHFWO4qtscQQmSgw/Ydbc=; b=m u522N55nnwGrkVcI+IIxNhXkCw6V0TAGw1ywvBy/lvEhALNAeaFNaambw4s0C9ee anRwi1JDFFIHxz6fAVX9MgDxjwm6Rwfo7japVHGtJk72HJiwtmLnFi7qriZENQul 9rOTeZ0C+28jJUqb7GYcFiTK0gUVL03eZ5/BlKv7KTilyuiMaB1eZTR9rzIRWjKG 5UmcyQFyxOLIIc189mBs+54LpBqiizc2YbXQuDGswt3Mszu8IsAfpHwW+A2pBhVp SAn5obSgJPa8mA8+V+ho00C1XxjHT13SqNL6pogzjNqW6d4+DzXbTSMK3C505qqG FTAExKIPeoTcITliBoxhg== 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 :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1762266145; x=1762352545; bh=q U812l4jocjIDwvg2vs463dHFWO4qtscQQmSgw/Ydbc=; b=G2zhnS9reI7a9xMo2 YnW0Q0IP722weqSPftYzmw0HN1B+LPcEan+IFsXSPnKrg8Lw1azuOJ0OsVQemHiS jp6SakChh/efvIkHH+rHAg16z+lCtbHnKqx3qHw+jkhL42FBdAsESRRqBbBYl/Sz G3+yTlrDdBCJlT8NVU1OgHGtiwvrCiajsJsajItURjxIKbd9142dPpEYosuZgVQ4 8xt1seUH26j40bHcFkyvUblFh6CUzBPOEB7sruZdXnuLNWz4T/tA0P+yQ1Am8CP8 scFncs5bpHIdqRTDqbOSy7qFt7GNyHePtIhVSS/P2ulPscLE+iWPwDmZXeZPwHu7 VBNsA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddukeduvdehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhg rhgvshhqlhdrohhrghdprhgtphhtthhopehmihgthhgrvghlsehprghquhhivghrrdighi ii X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Nov 2025 09:22:25 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1762266140; bh=NNFR+viVHTQPSpAZAvGLQkDdIBzWq/iY5jIYfQR94io=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=yqGHR4DwJ2oXHlTWuvsslWzTPC7bUdoVP5gd24wLjAAhny1JTZxP+THBy4zVxw6zX srZ+Ft/26GhXRZqGnyycJnvPV6bAZRXaujbcD3Q8o2vT0aW/u7pUQft1lxBZq71zrn OWM3Cgf2ngEtWus5GjJgFxWcCMAtXjR5dRR8rUHs2mOCkH1RgGVbT0bbH/yNJmulon UYkm6TdfcsIUKzvc4QIGfKl+ioh9fav4kW2xfCSYBs0QIO7Y6XE67pv+hT/ISk/OXj 3wXZqsO0yEVUrQbLH3QMd5BrfHG0Yi/8odia91rhafVr1jCds/hHUO+MdJRNfZLjg+ NmF4k9qgOBFlg== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id AEBC276; Tue, 04 Nov 2025 16:22:20 +0200 (EET) Date: Tue, 4 Nov 2025 15:22:20 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Michael Paquier Cc: Pg Hackers Subject: Re: BRIN autosummarization lacking a snapshot Message-ID: <202511041416.h2ksew7gzyhr@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202511041138.hqoddrfnei7w@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > With my initial try of this test, just counting the number of BRIN > tuples, I was _really_ surprised that the index did indeed contain the > expected number of tuples, even when the error was being thrown. This > turned out to be expected, because the way BRIN summarization works is > that we insert a placeholder tuple first, then update it to the correct > value, and the error only aborts the second part. One thing that's not fully clear to me, but will test later, is that if this has happened to you, then the placeholder tuple remains in place and doesn't ever become non-placeholder. If vacuum (incl. autovacuum) sees such a tuple, it will gladly ignore the page range, as if it were already summarized. This makes your index scans potentially inefficient, because for placeholder tuples bringetbitmap will always include the affected page range. I think we should make vacuum clean it up somehow, but I'm not yet sure how safe it is. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "El Maquinismo fue proscrito so pena de cosquilleo hasta la muerte" (Ijon Tichy en Viajes, Stanislaw Lem)