Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2b1759e

Browse files
committed
Remove unnecessary BufferGetPage() calls in fsm_vacuum_page().
Just noticed that these were quite redundant, since we're holding the page address in a local variable anyway, and we have pin on the buffer throughout. Also improve a comment.
1 parent a063baa commit 2b1759e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/backend/storage/freespace/freespace.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -866,20 +866,21 @@ fsm_vacuum_page(Relation rel, FSMAddress addr,
866866
if (fsm_get_avail(page, slot) != child_avail)
867867
{
868868
LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
869-
fsm_set_avail(BufferGetPage(buf), slot, child_avail);
869+
fsm_set_avail(page, slot, child_avail);
870870
MarkBufferDirtyHint(buf, false);
871871
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
872872
}
873873
}
874874
}
875875

876876
/* Now get the maximum value on the page, to return to caller */
877-
max_avail = fsm_get_max_avail(BufferGetPage(buf));
877+
max_avail = fsm_get_max_avail(page);
878878

879879
/*
880880
* Reset the next slot pointer. This encourages the use of low-numbered
881881
* pages, increasing the chances that a later vacuum can truncate the
882-
* relation.
882+
* relation. We don't bother with a lock here, nor with marking the page
883+
* dirty if it wasn't already, since this is just a hint.
883884
*/
884885
((FSMPage) PageGetContents(page))->fp_next_slot = 0;
885886

0 commit comments

Comments
 (0)