PostgreSQL Optimisation and SHA1 pass encryption