Improvements in SQL connections, to prevent buffer overload
More improvements to avoid SQL buffer overload