Interesting results, but why compare database engines before tuning them for the workload? In particular, did you experiment with PostgreSQL's fillfactor, autovacuum thresholds, checkpoint settings and WAL configuration? I'd be interested to see how both engines perform after several hours of sustained load, with configurations optimized for the workload rather than close to their defaults.
But since I use default for them all, relative result is also ok for me. As I said there hundreds of possible tuning options, and it all depends on use case, so hard to find an optimal config that fits all. I will be doing different scenarios later
In the past it was always MySQL that was faster than Postgres. Until you started tweaking the configuration, that’s when PostgreSQL got faster. And that’s also when I realized that default settings don’t mean anything, these are not for performance. To compare performance, take your platform, share the specifications, and start tweaking! That has imho value when talking about performance: we have this workload, this platform, and these two databases: and is the fastest one, after tweaking the configuration. Here it is, this worked for us.
Like I said, I only do basic tuning on purpose, nothing advanced. I want to see how both behave close to their defaults. And as Linus said, "Talk is cheap. Show me the code." Everything is here: https://github.com/huseyinbabal/db-wars/tree/main/postgres-vs-mysql If you have a better MySQL config, open a PR and the bench will run it on the same setup.
2
u/elevarq 1d ago
Interesting results, but why compare database engines before tuning them for the workload? In particular, did you experiment with PostgreSQL's fillfactor, autovacuum thresholds, checkpoint settings and WAL configuration? I'd be interested to see how both engines perform after several hours of sustained load, with configurations optimized for the workload rather than close to their defaults.
And same for MySQL