Attached patch slightly simplifies nbtsort.c by making it use PageIndexTupleOverwrite() to overwrite the last right non-pivot tuple with the new high key (pivot tuple). PageIndexTupleOverwrite() is designed so that code like this doesn't need to delete and re-insert to replace an existing tuple.
This slightly simplifies the code, and also makes it marginally faster. I'll add this to the 2019-09 CF. -- Peter Geoghegan
0001-Overwrite-lastright-item-with-highkey-in-nbtsort.c.patch
Description: Binary data