Update LFC cache hit/miss counters

Fixes EXPLAIN (FILECACHE) option
This commit is contained in:
Heikki Linnakangas
2025-07-10 16:36:30 +03:00
parent dcf8e0565f
commit bceafc6c32

View File

@@ -889,6 +889,9 @@ retry:
elog(DEBUG1, "read from local cache file was superseded by concurrent update");
goto retry;
}
pgBufferUsage.file_cache.hits += nblocks;
return;
}
Assert(request_idx == my_next_slot_idx);
@@ -898,6 +901,12 @@ retry:
inflight_requests[num_inflight_requests] = request_idx;
num_inflight_requests++;
/*
* XXX: If some blocks were in cache but not others, we count all blocks
* as a cache miss.
*/
pgBufferUsage.file_cache.misses += nblocks;
wait_request_completion(request_idx, &result);
Assert(num_inflight_requests == 1);
Assert(inflight_requests[0] == request_idx);