Postgres Function Vs Procedure Performance