aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2020-04-08 02:06:00 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2020-04-08 02:15:47 +0200
commit2b88fdde30d8e9bf833b75a014189e9148233b85 (patch)
treeb53c5681d7cf6ae8efa29fa36c2cae0b5fbfa334 /src
parent91c40548d5f7a9241d9fa344fae8069cfdb92bf2 (diff)
downloadpostgresql-2b88fdde30d8e9bf833b75a014189e9148233b85.tar.gz
postgresql-2b88fdde30d8e9bf833b75a014189e9148233b85.zip
Track SLRU page hits in SimpleLruReadPage_ReadOnly
SLRU page hits were tracked only in SimpleLruReadPage, but that's not enough because we may hit the page in SimpleLruReadPage_ReadOnly in which case we don't call SimpleLruReadPage at all. Reported-by: Kuntal Ghosh Discussion: https://postgr.es/m/20200119143707.gyinppnigokesjok@development
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/slru.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c
index de3c94105d1..b2316af7794 100644
--- a/src/backend/access/transam/slru.c
+++ b/src/backend/access/transam/slru.c
@@ -491,6 +491,10 @@ SimpleLruReadPage_ReadOnly(SlruCtl ctl, int pageno, TransactionId xid)
{
/* See comments for SlruRecentlyUsed macro */
SlruRecentlyUsed(shared, slotno);
+
+ /* update the stats counter of pages found in the SLRU */
+ pgstat_count_slru_page_hit(ctl);
+
return slotno;
}
}