On Fri, May 10, 2024 at 10:54:07AM +0200, Anthonin Bonnefoy wrote: > This patch replaces those Vacuum specific variables by pgBufferUsage > in analyze. This makes VacuumPage{Hit,Miss,Dirty} unused and removable. > This commit removes both their calls in bufmgr and their declarations.
Hmm, yeah, it looks like you're right. I can track all the blocks read, hit and dirtied for VACUUM and ANALYZE in all the code path where these removed variables were incremented. This needs some runtime check to make sure that the calculations are consistent before and after the fact (cannot do that now). appendStringInfo(&buf, _("buffer usage: %lld hits, %lld misses, %lld dirtied\n"), - (long long) AnalyzePageHit, - (long long) AnalyzePageMiss, - (long long) AnalyzePageDirty); + (long long) (bufferusage.shared_blks_hit + bufferusage.local_blks_hit), + (long long) (bufferusage.shared_blks_read + bufferusage.local_blks_read), + (long long) (bufferusage.shared_blks_dirtied + bufferusage.local_blks_dirtied)); Perhaps this should say "read" rather than "miss" in the logs as the two read variables for the shared and local blocks are used? For consistency, at least. That's not material for v17, only for v18. -- Michael
signature.asc
Description: PGP signature