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

Commit0dd6ff0

Browse files
committed
Avoid some unnecessary block reads in WAL reader
When reading a new page internally and depending on the way the WALreader facility gets used by plugins, the current implementation of theWAL reader may finish by reading a block multiple times while it is notactually necessary as the requested data length may be equal to what hasbeen already read. This can happen for any size, but is more likely tohappen at the end of a page. This can cause performance penalties inplugins which rely on the block reads to be purely sequential, zlib notliking backward reads for example. The new behavior also shaves somecycles when doing recovery.Author: Arthur ZakirovReviewed-by: Andrey Lepikhov, Michael Paquier, Grigory SmolkinDiscussion:https://postgr.es/m/2ddf4a32-517e-d6f4-d992-4a63b6035bfd@postgrespro.ru
1 parent0b55aaa commit0dd6ff0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/access/transam/xlogreader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, int reqLen)
536536

537537
/* check whether we have all the requested data already */
538538
if (targetSegNo==state->readSegNo&&targetPageOff==state->readOff&&
539-
reqLen<state->readLen)
539+
reqLen <=state->readLen)
540540
returnstate->readLen;
541541

542542
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp