Reduce more the number of calls to GetMaxBackends()
authorMichael Paquier <michael@paquier.xyz>
Thu, 10 Feb 2022 01:27:29 +0000 (10:27 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 10 Feb 2022 01:27:29 +0000 (10:27 +0900)
commit4567596316d186c6e61c72df013797266fcac2f7
treeb1dba64375bc8b58dc6afd4ec041b19fb6704759
parentf0cd9097cfac435ec18ab2595c81f13a14736758
Reduce more the number of calls to GetMaxBackends()

Some of the code paths changed by aa64f23 can reduce the number of times
GetMaxBackends() is called.  The performance gain is marginal, but most
of the code changed by this commit already did that.  Hence, let's be
clean and apply the same rule everywhere, for consistency.

Some of the code paths, like in deadlock.c, involve only assertions.
These are left unchanged.

Reviewed-by: Nathan Bossart, Robert Haas
Discussion: https://postgr.es/m/YgMpGZhPOjNfS7er@paquier.xyz
src/backend/commands/async.c
src/backend/storage/lmgr/lock.c
src/backend/utils/adt/lockfuncs.c