mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Move BufferGetBlockNumber() out of heap_page_is_all_visible()'s inner loop.
In some workloads BufferGetBlockNumber() shows up in profiles due to the sheer number of calls to it (and because it causes cache misses). The compiler can't move it out of the loop because it's a full extern function call...
This commit is contained in:
parent
6c878edc1d
commit
0c5af0a537
@ -1754,6 +1754,7 @@ static bool
|
||||
heap_page_is_all_visible(Relation rel, Buffer buf, TransactionId *visibility_cutoff_xid)
|
||||
{
|
||||
Page page = BufferGetPage(buf);
|
||||
BlockNumber blockno = BufferGetBlockNumber(buf);
|
||||
OffsetNumber offnum,
|
||||
maxoff;
|
||||
bool all_visible = true;
|
||||
@ -1778,7 +1779,7 @@ heap_page_is_all_visible(Relation rel, Buffer buf, TransactionId *visibility_cut
|
||||
if (!ItemIdIsUsed(itemid) || ItemIdIsRedirected(itemid))
|
||||
continue;
|
||||
|
||||
ItemPointerSet(&(tuple.t_self), BufferGetBlockNumber(buf), offnum);
|
||||
ItemPointerSet(&(tuple.t_self), blockno, offnum);
|
||||
|
||||
/*
|
||||
* Dead line pointers can have index pointers pointing to them. So
|
||||
|
Loading…
x
Reference in New Issue
Block a user