before optimizing postgresql