Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf01157e

Browse files
Further simplify nbtree high key truncation.
Commit7c2dbc6 reorganized _bt_truncate() in a way that enables afurther simplification that I (pgeoghegan) missed: Since we mark thetuple that is returned to the caller as a pivot tuple before the pointwhere its heap TID is set as of7c2dbc6, it is possible to use the highlevel BTreeTupleGetHeapTID() inline function to get an item pointer. Doit that way now. This approach is clearer and more maintainable.
1 parentdd9ac7d commitf01157e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/backend/access/nbtree/nbtutils.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,6 +2251,7 @@ _bt_truncate(Relation rel, IndexTuple lastleft, IndexTuple firstright,
22512251
tidpivot->t_info |=newsize;
22522252
BTreeTupleSetNAtts(tidpivot,nkeyatts);
22532253
BTreeTupleSetAltHeapTID(tidpivot);
2254+
pivotheaptid=BTreeTupleGetHeapTID(tidpivot);
22542255

22552256
/*
22562257
* Lehman & Yao use lastleft as the leaf high key in all cases, but don't
@@ -2259,8 +2260,6 @@ _bt_truncate(Relation rel, IndexTuple lastleft, IndexTuple firstright,
22592260
* TID. (This is also the closest value to negative infinity that's
22602261
* legally usable.)
22612262
*/
2262-
pivotheaptid= (ItemPointer) ((char*)tidpivot+newsize-
2263-
sizeof(ItemPointerData));
22642263
ItemPointerCopy(BTreeTupleGetMaxHeapTID(lastleft),pivotheaptid);
22652264

22662265
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp