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

Commita7b9d24

Browse files
Make deduplication use number of key attributes.
Use IndexRelationGetNumberOfKeyAttributes() rather thanIndexRelationGetNumberOfAttributes() when determining whether or not twoindex tuples are suitable for merging together into a single postinglist tuple. This is a little bit tidier. It brings affected code innbtdedup.c a little closer to similar, related code in nbtsplitloc.c.
1 parent9950c8a commita7b9d24

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ _bt_dedup_one_page(Relation rel, Buffer buf, Relation heapRel,
6868
intndeletable=0;
6969
Sizepagesaving=0;
7070
boolsinglevalstrat= false;
71-
intnatts=IndexRelationGetNumberOfAttributes(rel);
71+
intnkeyatts=IndexRelationGetNumberOfKeyAttributes(rel);
7272

7373
/*
7474
* We can't assume that there are no LP_DEAD items. For one thing, VACUUM
@@ -182,7 +182,7 @@ _bt_dedup_one_page(Relation rel, Buffer buf, Relation heapRel,
182182
_bt_dedup_start_pending(state,itup,offnum);
183183
}
184184
elseif (state->deduplicate&&
185-
_bt_keep_natts_fast(rel,state->base,itup)>natts&&
185+
_bt_keep_natts_fast(rel,state->base,itup)>nkeyatts&&
186186
_bt_dedup_save_htid(state,itup))
187187
{
188188
/*
@@ -519,19 +519,19 @@ static bool
519519
_bt_do_singleval(Relationrel,Pagepage,BTDedupStatestate,
520520
OffsetNumberminoff,IndexTuplenewitem)
521521
{
522-
intnatts=IndexRelationGetNumberOfAttributes(rel);
522+
intnkeyatts=IndexRelationGetNumberOfKeyAttributes(rel);
523523
ItemIditemid;
524524
IndexTupleitup;
525525

526526
itemid=PageGetItemId(page,minoff);
527527
itup= (IndexTuple)PageGetItem(page,itemid);
528528

529-
if (_bt_keep_natts_fast(rel,newitem,itup)>natts)
529+
if (_bt_keep_natts_fast(rel,newitem,itup)>nkeyatts)
530530
{
531531
itemid=PageGetItemId(page,PageGetMaxOffsetNumber(page));
532532
itup= (IndexTuple)PageGetItem(page,itemid);
533533

534-
if (_bt_keep_natts_fast(rel,newitem,itup)>natts)
534+
if (_bt_keep_natts_fast(rel,newitem,itup)>nkeyatts)
535535
return true;
536536
}
537537

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp