Hello,
after reviewing the patch together with Miłosz, we found the following:
- In pgstatfuncs.c, we call pgstat_fetch_stat_backend_by_pid(beentry->st_procpid, NULL) for each backend row. That path
acquiresProcArrayLock via BackendPidGetProc(), so this repeats lock acquisition for every row. We could simplify this
andavoid taking the lock altogether by fetching directly with pgstat_fetch_stat_backend(local_beentry->proc_number).
Also, shouldn't this patch bump catversion?
Regards,
Kuba
The new status of this patch is: Waiting on Author