postgres.git / summary / log / commit / refs
commit 2b88fdde30d8e9bf833b75a014189e9148233b85
Author: Tomas Vondra <tomas.vondra@postgresql.org>
Date: Wed Apr 08 00:06:00 2020 +0000
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
src/backend/access/transam/slru.c | 4 ++++
1 file changed, 4 insertions(+)
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;
}
}
[parent: 91c40548d5f7]