Made postgresql a bit efficient