diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-10-31 14:54:41 +0530 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-10-31 14:56:09 +0530 |
commit | ee4673ac071f8352c41cc673299b7ec695f079ff (patch) | |
tree | 533f779d7e15479ba04479520623885afb31a96f /src | |
parent | cf7ab13bfb450dde50c86fa714a92964ce32b537 (diff) | |
download | postgresql-ee4673ac071f8352c41cc673299b7ec695f079ff.tar.gz postgresql-ee4673ac071f8352c41cc673299b7ec695f079ff.zip |
Don't exaggerate the number of temporary blocks read.
A read that returns zero bytes (or an error) should not increment
the number of temporary blocks read.
Thomas Munro
Discussion: http://postgr.es/m/CAEepm=21xgihg=WaG+O5MFotEZfN6kFETpfw+RkSnEqNQqGn2Q@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/file/buffile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c index 4ca0ea4f2a3..de85b6805c2 100644 --- a/src/backend/storage/file/buffile.c +++ b/src/backend/storage/file/buffile.c @@ -264,7 +264,8 @@ BufFileLoadBuffer(BufFile *file) file->offsets[file->curFile] += file->nbytes; /* we choose not to advance curOffset here */ - pgBufferUsage.temp_blks_read++; + if (file->nbytes > 0) + pgBufferUsage.temp_blks_read++; } /* |