I just recently "upgraded" to High Sierra and experiencing horrendous CREATE DATABASE
performance. Creating a database from a 3G template DB used to take ~1m but post-upgrade is taking ~22m at a sustained write of around 4MB/s. Occasionally, attempting to create an empty database hangs indefinitely as well. When this happens, restarting the Postgres server allows empty database initialization in ~1s.
I had been running on an encrypted APFS volume (FileVault), but after dropping encryption, saw the tasks drop to about ~15m per run. Still a far cry from the previous ~1m threshold.
A multi-threaded pg_restore
seems to sustain writes of ~38M/s and completes in about the same time as pre-upgrade (Sierra), so I'm not sure it's entirely related to APFS / disk IO.
I've completely rebuilt the Postgres data directory, re-installed Postgres (Postgres.app 2.0.5) etc. I don't have any reasonable explanation for what could have broken so catastrophically.
Coworker has seen the exact same issue. Has anyone else experienced this yet or have any insight as to what could be happening?
Thanks in advance!