Some minor PSQL speed improvements