Commit 28c16f4
committed
Remove unnecessary PageIsEmpty() nbtree build check.
nbtree index builds cannot write out an empty page. That would mean
that there was no way to create a pivot tuple pointing to the page one
level up, since _bt_truncate() generates one based on page's firstright
tuple.
Replace the unnecessary PageIsEmpty() check with an assertion that
checks that the page has space for at least two line pointers (the
would-be high key line pointer, plus at least one valid "data item"
tuple line pointer).
The PageIsEmpty() check was added by commit 5d9f146 over 20 years ago.
It looks like it has always been unnecessary.1 parent f7f70d5 commit 28c16f4
1 file changed
+18
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
728 | 731 | | |
729 | 732 | | |
730 | | - | |
| 733 | + | |
731 | 734 | | |
732 | 735 | | |
733 | 736 | | |
734 | 737 | | |
735 | | - | |
736 | 738 | | |
737 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
738 | 743 | | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
748 | 748 | | |
| 749 | + | |
749 | 750 | | |
750 | 751 | | |
751 | 752 | | |
| |||
0 commit comments