Re: ERROR: found unexpected null value in index - Mailing list pgsql-bugs

From Tom Lane
Subject Re: ERROR: found unexpected null value in index
Date
Msg-id 21234.1562801346@sss.pgh.pa.us
Whole thread Raw
In response to Re: ERROR: found unexpected null value in index  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: ERROR: found unexpected null value in index  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Peter Geoghegan <pg@bowt.ie> writes:
> On Wed, Jul 10, 2019 at 3:26 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I was imagining it would still check the heap, if necessary, to verify
>> that it'd found a tuple passing the given snapshot.

> Not sure I follow. When or how would it not be necessary? Are you
> merely referring to the simple case where the LP_DEAD bit is already
> set for the item on the B-Tree leaf page?

Index-only scans already have the LP_DEAD fast path (don't return value)
and the all_visible fast path (always return value), and otherwise they
do a heap visit.  If we can use a custom visibility test in the heap
visit and not muck up the opportunity to set LP_DEAD when relevant, then
it seems like using the IOS code path will do exactly what we want.
Otherwise some finagling might be necessary.  But it still might be
cleaner than directly looking at HOT-update status.

I'll take a look at that tomorrow if nobody beats me to it.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: ERROR: found unexpected null value in index
Next
From: Michael Paquier
Date:
Subject: Re: BUG #15888: Bogus "idle in transaction" state for logicaldecoding client after creating a slot