postgresql/src/backend/access
Peter Geoghegan 7505da2f45 Reverse order of newitem nbtree candidate splits.
Commit fab25024, which taught nbtree to choose candidate split points
more carefully, had _bt_findsplitloc() record all possible split points
in an initial pass over a page that is about to be split.  The order
that candidate split points were processed and stored in was assumed to
match the offset number order of split points on an imaginary version of
the page that contains the same items as the original, but also fits
newitem (the item that provoked the split precisely because it didn't
fit).

However, the order of split points in the final array was not quite what
was expected: the split point that makes newitem the firstright item
came after the split point that makes newitem the lastleft item -- not
before.  As a result, _bt_findsplitloc() could get confused about the
leftmost and rightmost tuples among all possible split points recorded
for the page.  This seems to have no appreciable impact on the quality
of the final split point chosen by _bt_findsplitloc(), but it's still
wrong.

To fix, switch the order in which newitem candidate splits are recorded
in.  This also makes it possible to describe candidate split points in
terms of which pair of adjoining tuples enclose the split point within
_bt_findsplitloc(), making it clearer why it's generally safe for
_bt_split() to expect lastleft and firstright tuples.
2019-05-15 12:22:07 -07:00
..
brin Revert "Avoid the creation of the free space map for small heap relations". 2019-05-07 09:30:24 +05:30
common Fix typos in reloptions.c 2019-04-12 12:56:38 +09:00
gin Make queries' locking of indexes more consistent. 2019-04-04 15:12:58 -04:00
gist Detect internal GiST page splits correctly during index build. 2019-05-14 13:18:44 +03:00
hash Widen tuple counter variables from long to int64 2019-04-30 10:27:38 -04:00
heap Handle table_complete_speculative's succeeded argument as documented. 2019-05-14 12:19:32 -07:00
index Standardize ItemIdData terminology. 2019-05-13 15:53:39 -07:00
nbtree Reverse order of newitem nbtree candidate splits. 2019-05-15 12:22:07 -07:00
rmgrdesc Convert gist to compute page level xid horizon on primary. 2019-04-22 14:28:30 -07:00
spgist Standardize ItemIdData terminology. 2019-05-13 15:53:39 -07:00
table Message style fixes 2019-04-30 10:33:37 -04:00
tablesample tableam: sample scan. 2019-03-31 18:37:57 -07:00
transam Clean up the behavior and API of catalog.c's is-catalog-relation tests. 2019-05-08 23:27:38 -04:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00