Re: ERROR: found unexpected null value in index
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Andres Freund <andres@anarazel.de>,
Manuel Rigger <rigger.manuel@gmail.com>,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-07-10T23:29:06Z
Lists: 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
Commits
-
Fix get_actual_variable_range() to cope with broken HOT chains.
- d3751adcf14d 13.0 landed
- cee976c4e8c4 12.0 landed
- 5c1b7edc23a0 11.5 landed
-
Improve performance of get_actual_variable_range with recently-dead tuples.
- 3ca930fc39cc 11.0 cited