Re: More problems with VacuumPageHit style global variables

2022-04-21 Thread Peter Geoghegan
On Thu, Apr 21, 2022 at 4:28 PM Peter Geoghegan wrote: > I don't think that there is any risk of one user of either variable > "clobbering" some other user -- the current values of the variables > are not actually meaningful at all. They're only useful as a way that > an arbitrary piece of code

Re: More problems with VacuumPageHit style global variables

2022-04-21 Thread Peter Geoghegan
On Wed, Apr 20, 2022 at 8:00 PM Peter Geoghegan wrote: > I knew about pgBufferUsage, and I knew about > VacuumPage{Hit,Miss,Dirty} for a long time. But somehow I didn't make > the very obvious connection between the two until today. I am probably > not the only one. What about

Re: More problems with VacuumPageHit style global variables

2022-04-20 Thread Peter Geoghegan
On Wed, Apr 20, 2022 at 7:50 PM Thomas Munro wrote: > As for your general question, I think you must be right. From a quick > rummage around in the commit log, it does appear that commit cddca5ec > (2009), which introduced pgBufferUsage, always bumped the counters > unconditionally. It predated

Re: More problems with VacuumPageHit style global variables

2022-04-20 Thread Thomas Munro
On Thu, Apr 21, 2022 at 10:03 AM Peter Geoghegan wrote: > I just realized that there is one remaining problem: parallel VACUUM > doesn't care about these global variables, so there will still be > discrepancies there. I can't really blame that on parallel VACUUM, > though, because

More problems with VacuumPageHit style global variables

2022-04-20 Thread Peter Geoghegan
My recent bugfix commit d3609dd2 addressed an issue with VACUUM VERBOSE. It would aggregate buffers hit/missed/dirtied counts incorrectly (by double counting), though only when there are multiple heap rels processed by the same VACUUM command. It failed to account for the fact that the