db connection optimizations