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

Commitf0e72a2

Browse files
committed
Improve handling of dead tuples in hash indexes.
When squeezing a bucket during vacuum, it's not necessary to retainany tuples already marked as dead, so ignore them when deciding whichtuples must be moved in order to empty a bucket page. Similarly, whensplitting a bucket, relocating dead tuples to the new bucket is awaste of effort; instead, just ignore them.Amit Kapila, reviewed by me. Testing help provided by AshutoshSharma.
1 parent650b967 commitf0e72a2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

‎src/backend/access/hash/hashovfl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,10 @@ _hash_squeezebucket(Relation rel,
656656
IndexTupleitup;
657657
Sizeitemsz;
658658

659+
/* skip dead tuples */
660+
if (ItemIdIsDead(PageGetItemId(rpage,roffnum)))
661+
continue;
662+
659663
itup= (IndexTuple)PageGetItem(rpage,
660664
PageGetItemId(rpage,roffnum));
661665
itemsz=IndexTupleDSize(*itup);

‎src/backend/access/hash/hashpage.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,10 @@ _hash_splitbucket(Relation rel,
811811
Sizeitemsz;
812812
Bucketbucket;
813813

814+
/* skip dead tuples */
815+
if (ItemIdIsDead(PageGetItemId(opage,ooffnum)))
816+
continue;
817+
814818
/*
815819
* Fetch the item's hash key (conveniently stored in the item) and
816820
* determine which bucket it now belongs in.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp