From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Manuel Rigger <rigger.manuel@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: ERROR: found unexpected null value in index
Date: Wed, 10 Jul 2019 16:48:27 -0400
Message-ID: <14524.1562791707@sss.pgh.pa.us> (raw)
In-Reply-To: <FB9B6E43-B722-4291-A97A-2BF240A312E5@anarazel.de>
References: <CA+u7OA7W4NWEhCvftdV6_8bbm2vgypi5nuxfnSEJQqVKFSUoMg@mail.gmail.com>
<9288.1562720919@sss.pgh.pa.us>
<CAH2-Wzm41rs0Ee=zi-qWQVpgZoZkY4aq8_ZBFCUK+BGJrOo47g@mail.gmail.com>
<20825.1562723034@sss.pgh.pa.us>
<CAH2-Wz=+N+QZ=+ACv3PQ8LqXmsMbfuMviGTYg7X5rwE6xT2L=Q@mail.gmail.com>
<8251.1562726821@sss.pgh.pa.us>
<CAH2-WzkNv-HyAGvkkq4ymv1fJTr+jrLCQqiXaopXSE3DUo_ncA@mail.gmail.com>
<12489.1562788970@sss.pgh.pa.us>
<20190710201547.l6vs6y3cf2tuac73@alap3.anarazel.de>
<13550.1562790349@sss.pgh.pa.us>
<FB9B6E43-B722-4291-A97A-2BF240A312E5@anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> On July 10, 2019 1:25:49 PM PDT, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The problem here isn't whether the heap tuple is live or dead, it's
>> whether it can be trusted to match the index entry.
> Well, if we defined i the snapshot semantics as "return rows that are not vacuumable and safe for selfuncs.c considerations" it seems like a visibility concern if you squint a tiny bit. It's a mostly checking for certain kinds of dead rows, after all.
Hm, maybe. I was considering making it work like "apply
SnapshotNonVacuumable if the tuple isn't HOT_UPDATED, but some stricter
liveness check if it is". It didn't seem like there was much to be gained
that way given how HeapTupleHeaderIsHotUpdated works ... or, perhaps,
you could say that HeapTupleHeaderIsHotUpdated is already applying a very
strict liveness check.
>> Also, snapshot
>> checking isn't really below the AM API anyway is it?
> It is, imo.
Ah, I see HeapTupleSatisfiesVisibility has already been pushed down
below that horizon. So I agree, we might be able to finesse this by
pushing the hot-update consideration into HeapTupleSatisfiesNonVacuumable,
or making another snapshot_type that does what we need.
>> I wonder if we'd be better off to switch over to using data directly
>> from the index entry, rather than trying to recover it from the heap.
> Hm, that doesn't sound like a trivial change.
Not sure. We know we're dealing with btree, and it can always do
index-only scans, so it's certainly possible. But the relevant
APIs might not be conducive to getting what we want.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, pg@bowt.ie, rigger.manuel@gmail.com
Subject: Re: ERROR: found unexpected null value in index
In-Reply-To: <14524.1562791707@sss.pgh.pa.us>
References: <CA+u7OA7W4NWEhCvftdV6_8bbm2vgypi5nuxfnSEJQqVKFSUoMg@mail.gmail.com> <9288.1562720919@sss.pgh.pa.us> <CAH2-Wzm41rs0Ee=zi-qWQVpgZoZkY4aq8_ZBFCUK+BGJrOo47g@mail.gmail.com> <20825.1562723034@sss.pgh.pa.us> <CAH2-Wz=+N+QZ=+ACv3PQ8LqXmsMbfuMviGTYg7X5rwE6xT2L=Q@mail.gmail.com> <8251.1562726821@sss.pgh.pa.us> <CAH2-WzkNv-HyAGvkkq4ymv1fJTr+jrLCQqiXaopXSE3DUo_ncA@mail.gmail.com> <12489.1562788970@sss.pgh.pa.us> <20190710201547.l6vs6y3cf2tuac73@alap3.anarazel.de> <13550.1562790349@sss.pgh.pa.us> <FB9B6E43-B722-4291-A97A-2BF240A312E5@anarazel.de> <14524.1562791707@sss.pgh.pa.us>
* 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