projects
/
users
/
gsingh
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf7ab13
)
Don't exaggerate the number of temporary blocks read.
author
Robert Haas
<rhaas@postgresql.org>
Tue, 31 Oct 2017 09:24:41 +0000
(14:54 +0530)
committer
Robert Haas
<rhaas@postgresql.org>
Tue, 31 Oct 2017 09:26:09 +0000
(14:56 +0530)
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
src/backend/storage/file/buffile.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/storage/file/buffile.c
b/src/backend/storage/file/buffile.c
index 4ca0ea4f2a343fc1bdd134a96be556252db5a4ca..de85b6805c2a16399864afb3172cdf16d1c38e27 100644
(file)
--- 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++;
}
/*