I'm working with a non-local postgresql database and it is slow due to hundreds of queries being fired off for every change of page in the GUI. I'm not sure if it's reusing connections or reconnecting each time. Does anyone have any optimizations that would help improve this?