pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Michael Paquier <michael@paquier.xyz>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: BRIN autosummarization lacking a snapshot
Date: Tue, 4 Nov 2025 15:22:20 +0100
Message-ID: <202511041416.h2ksew7gzyhr@alvherre.pgsql> (raw)
In-Reply-To: <202511041138.hqoddrfnei7w@alvherre.pgsql>


> 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)





view thread (8+ messages)  latest in thread

Message-ID: <202511041416.h2ksew7gzyhr@alvherre.pgsql>
Permalink:  ../202511041416.h2ksew7gzyhr@alvherre.pgsql/
Also on:    postgresql.org/message-id/202511041416.h2ksew7gzyhr@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@kurilemu.de, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
  Subject: Re: BRIN autosummarization lacking a snapshot
  In-Reply-To: <202511041416.h2ksew7gzyhr@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox