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

Commit2b1759e

Browse files
committed
Remove unnecessary BufferGetPage() calls in fsm_vacuum_page().
Just noticed that these were quite redundant, since we're holding thepage address in a local variable anyway, and we have pin on the bufferthroughout.Also improve a comment.
1 parenta063baa commit2b1759e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/backend/storage/freespace/freespace.c

Lines changed: 4 additions & 3 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp