On 12/2/16 12:52 PM, Tom Lane wrote:
I think you misread it. Note the "n > 0" part of the while condition.
*facepalm*
Sorry for the noise...
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble
Jim Nasby writes:
> Current HaveNFreeProcs() iterates through the entire freeProcs list
> (while holding ProcStructLock) just to determine if there's a small
> number (superuser_reserved_connections) of free slots available.
I think you misread it. Note the "n > 0" part of the while condition.
Current HaveNFreeProcs() iterates through the entire freeProcs list
(while holding ProcStructLock) just to determine if there's a small
number (superuser_reserved_connections) of free slots available. For the
common case, presumably it'd be faster to put the n<=0 test inside the
loop and return