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

Commit0c5af0a

Browse files
committed
Move BufferGetBlockNumber() out of heap_page_is_all_visible()'s inner loop.
In some workloads BufferGetBlockNumber() shows up in profiles due tothe sheer number of calls to it (and because it causes cachemisses). The compiler can't move it out of the loop because it's afull extern function call...
1 parent6c878ed commit0c5af0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/commands/vacuumlazy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,6 +1754,7 @@ static bool
17541754
heap_page_is_all_visible(Relationrel,Bufferbuf,TransactionId*visibility_cutoff_xid)
17551755
{
17561756
Pagepage=BufferGetPage(buf);
1757+
BlockNumberblockno=BufferGetBlockNumber(buf);
17571758
OffsetNumberoffnum,
17581759
maxoff;
17591760
boolall_visible= true;
@@ -1778,7 +1779,7 @@ heap_page_is_all_visible(Relation rel, Buffer buf, TransactionId *visibility_cut
17781779
if (!ItemIdIsUsed(itemid)||ItemIdIsRedirected(itemid))
17791780
continue;
17801781

1781-
ItemPointerSet(&(tuple.t_self),BufferGetBlockNumber(buf),offnum);
1782+
ItemPointerSet(&(tuple.t_self),blockno,offnum);
17821783

17831784
/*
17841785
* Dead line pointers can have index pointers pointing to them. So

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp