| From: | Peter Geoghegan <pg(at)bowt(dot)ie> |
|---|---|
| To: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de> |
| Subject: | Re: More problems with VacuumPageHit style global variables |
| Date: | 2022-04-21 23:53:08 |
| Message-ID: | CAH2-WzkrCeBwKV-sA1Q8VW7Uf8ghuFyynWqF1gfNphZvkAMBBQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Apr 21, 2022 at 4:28 PM Peter Geoghegan <pg(at)bowt(dot)ie> 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 instruments an arbitrary operation, by
> making their own copies, running whatever the operation is, and then
> reporting on the deltas. Which makes it even more surprising that this
> was overlooked until now.
I suppose code like pgstat_update_dbstats() would need to copy
pgBufferUsage somewhere if we were to get rid of pgStatBlockReadTime
and pgStatBlockWriteTime. That might not have been acceptable back
when we had the old stats collector; frequent copying of pgBufferUsage
might have non-trivial overhead. The relevant struct (BufferUsage) has
over 10 64-bit integers, versus only 2 for pgStatBlockReadTime and
pgStatBlockWriteTime.
But does that matter anymore now that we have the cumulative stats
system? Doesn't the redundancy seem like a problem?
--
Peter Geoghegan
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Japin Li | 2022-04-22 01:51:03 | Re: Replace open mode with PG_BINARY_R/W/A macros |
| Previous Message | Peter Geoghegan | 2022-04-21 23:28:01 | Re: More problems with VacuumPageHit style global variables |