How does postgresql perform?

Because I just tried it and the performance was horrible. Just wanted to know if that was an issue with my setup or nextcloud.

i would say: postgresql.

may you share some infos about your setup?
did you look e.g. at PGTune - calculate configuration for PostgreSQL based on the maximum performance for a given hardware configuration for tuning tipps?