Some more performance improvements for Postgres