Re: [HACKERS] HaveNFreeProcs() iterates through entire freeProcs list

2016-12-02 Thread Jim Nasby
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

Re: [HACKERS] HaveNFreeProcs() iterates through entire freeProcs list

2016-12-02 Thread Tom Lane
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.

[HACKERS] HaveNFreeProcs() iterates through entire freeProcs list

2016-12-02 Thread Jim Nasby
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