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

Commit3bdca3d

Browse files
committed
Insert new item in the end of the page if it is the biggest item
1 parenta1da826 commit3bdca3d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

‎src/rumdatapage.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ rumMergeItemPointers(RumState * rumstate, AttrNumber attno, RumKey * dst,
409409

410410
/*
411411
* Checks, should we move to right link...
412-
* Compares insertingitemp pointer with right bound of current page
412+
* Compares insertingitem pointer with right bound of current page
413413
*/
414414
staticbool
415415
dataIsMoveRight(RumBtreebtree,Pagepage)
@@ -909,7 +909,9 @@ dataPlaceToPage(RumBtree btree, Page page, OffsetNumber off)
909909
if (stopAppend)
910910
/* there is no free space on page */
911911
break;
912-
elseif (RumPageRightMost(page))
912+
elseif (RumPageRightMost(page)||
913+
/* Insert item in the end of the page */
914+
off>maxoff)
913915
/* force insertion of new item */
914916
cmp=1;
915917
elseif ((cmp=compareRumKey(btree->rumstate,btree->entryAttnum,
@@ -1211,7 +1213,7 @@ dataSplitPageInternal(RumBtree btree, Buffer lbuf, Buffer rbuf,
12111213
OffsetNumberseparator;
12121214
RumKey*bound;
12131215
PagenewlPage=PageGetTempPageCopy(BufferGetPage(lbuf));
1214-
RumKeyoldbound=*RumDataPageGetRightBound(newlPage);
1216+
RumKeyoldbound=*RumDataPageGetRightBound(newlPage);
12151217
intsizeofitem=sizeof(PostingItem);
12161218
OffsetNumbermaxoff=RumPageGetOpaque(newlPage)->maxoff;
12171219
SizepageSize=PageGetPageSize(newlPage);

‎src/ruminsert.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ createPostingTree(RumState * rumstate, OffsetNumber attnum, Relation index,
9999
* are making a leaf-level key entry containing a posting list of nipd items.
100100
* If the caller is actually trying to make a posting-tree entry, non-leaf
101101
* entry, or pending-list entry, it should pass nipd = 0 and then overwrite
102-
* the t_tid fields as necessary. In any case,ipd can be NULL to skip
102+
* the t_tid fields as necessary. In any case,items can be NULL to skip
103103
* copying any itempointers into the posting list; the caller is responsible
104-
* for filling the posting list afterwards, ifipd = NULL and nipd > 0.
104+
* for filling the posting list afterwards, ifitems = NULL and nipd > 0.
105105
*/
106106
staticIndexTuple
107107
RumFormTuple(RumState*rumstate,
@@ -348,7 +348,6 @@ buildFreshLeafTuple(RumState * rumstate,
348348
if (size >=RumDataPageSize)
349349
itemsCount--;
350350

351-
352351
/*
353352
* Build posting-tree-only result tuple. We do this first so as to
354353
* fail quickly if the key is too big.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp