pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Andres Freund <andres@anarazel.de>
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 19:29:06 -0400
Message-ID: <21234.1562801346@sss.pgh.pa.us> (raw)
In-Reply-To: <CAH2-Wz=MAO7L_YEQhOg2yK41L2-Zk9=MCe6QJkkGRwhfihLkRg@mail.gmail.com>
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>
	<CAH2-Wz=FZhBWWMC=cYZuyinf7VJ9kTBs=bupcfDV=N8gCwhjuQ@mail.gmail.com>
	<18788.1562797589@sss.pgh.pa.us>
	<CAH2-Wz=MAO7L_YEQhOg2yK41L2-Zk9=MCe6QJkkGRwhfihLkRg@mail.gmail.com>

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





view thread (23+ messages)  latest in thread

Message-ID: <21234.1562801346@sss.pgh.pa.us>
Permalink:  ../21234.1562801346@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21234.1562801346@sss.pgh.pa.us

 · 

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 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, pg@bowt.ie, andres@anarazel.de, rigger.manuel@gmail.com
  Subject: Re: ERROR: found unexpected null value in index
  In-Reply-To: <21234.1562801346@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> <CAH2-Wz=FZhBWWMC=cYZuyinf7VJ9kTBs=bupcfDV=N8gCwhjuQ@mail.gmail.com> <18788.1562797589@sss.pgh.pa.us> <CAH2-Wz=MAO7L_YEQhOg2yK41L2-Zk9=MCe6QJkkGRwhfihLkRg@mail.gmail.com> <21234.1562801346@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