How to calculate max_open_cursors?