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: Manuel Rigger <rigger.manuel@gmail.com>,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-07-10T02:47:01Z
Lists: pgsql-bugs
Peter Geoghegan <pg@bowt.ie> writes: > I think that the issue is related to a broken HOT chain -- the index > doesn't even have any NULL key values, since the CREATE INDEX came > after the INSERT that added a NULL value. However, it does have a > tuple with the key value 'a' that points to the root of a HOT chain > whose first value for the indexed attribute is NULL. The successor > tuple's value for the indexed attribute is 'a', as expected (of > course, this is a normal state that > IndexBuildHeapScan()/heapam_index_build_range_scan() expect other code > to deal with). > Back when get_actual_variable_range() used a dirty snapshot, it would > have not seen any NULL value with this test case, because the root of > the HOT chain would be considered recently dead. Hm. So maybe we need to teach it to ignore tuples that are not the tips of their HOT chains? 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