forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6312c08
committed
nbtree: Use raw PageAddItem() for retail inserts.
Only internal page splits need to call _bt_pgaddtup() instead ofPageAddItem(), and only for data items, one of which will end up at thefirst offset (or first offset after the high key offset) on the newright page. This data item alone will need to be truncated in_bt_pgaddtup().Since there is no reason why retail inserts ever need to truncate theincoming item, use a raw PageAddItem() call there instead. Even_bt_split() uses raw PageAddItem() calls for left page and right pagehigh keys. Clearly the _bt_pgaddtup() shim function wasn't reallyencapsulating anything. _bt_pgaddtup() should now be thought of as a_bt_split() helper function.Note that the assertions from commitd1e241c verify that retail insertsnever insert an item at an internal page's negative infinity offset.This invariant could only ever be violated as a result of a basic logicerror in nbtinsert.c.1 parentd41202f commit6312c08
1 file changed
+19
-7
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1249 | 1249 |
| |
1250 | 1250 |
| |
1251 | 1251 |
| |
1252 |
| - | |
| 1252 | + | |
| 1253 | + | |
1253 | 1254 |
| |
1254 | 1255 |
| |
1255 | 1256 |
| |
| |||
2528 | 2529 |
| |
2529 | 2530 |
| |
2530 | 2531 |
| |
2531 |
| - | |
| 2532 | + | |
2532 | 2533 |
| |
2533 | 2534 |
| |
2534 | 2535 |
| |
2535 | 2536 |
| |
2536 | 2537 |
| |
2537 | 2538 |
| |
2538 |
| - | |
2539 |
| - | |
| 2539 | + | |
| 2540 | + | |
2540 | 2541 |
| |
2541 |
| - | |
2542 |
| - | |
2543 |
| - | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
2544 | 2556 |
| |
2545 | 2557 |
| |
2546 | 2558 |
| |
|
0 commit comments
Comments
(0)