The other thing that's going on in the patch is dynamic adjustment of spins_per_delay, and that could certainly be made much smarter than it is now. For instance, it'd cost almost nothing to make the lower and upper bounds for spins_per_delay be variables instead of constants. We could set the bounds during postmaster startup based on some criteria yet to be determined. regards, tom lane