This post documents how MySQL and Postgres performance has changed over time using sysbench. It compares QPS for Postgres 11.21 vs MySQL 5.6.21 and then Postgres 16.0 vs MySQL 8.0.34.
The focus here is on CPU overhead and for that a workload that is low-concurrency, CPU-bound and cached is sufficient. However a full comparison would also include results for workloads with more concurrency and workloads that are IO-bound.
The benchmark was explained in a series of posts - see part 1, part 2, part 3, part 4 and part 5 and the results here are from my small server. Usually I avoid direct comparisons between Postgres and MySQL but I am doing this because I care about the future of MySQL and the CPU regressions in it over time have become a problem.
- Postgres 11.21 and MySQL 5.6.21 have similar QPS on most sysbench tests
- Postgres 16.0 gets much more QPS than MySQL 8.0.34 on most sysbench tests
- The problem for MySQL is new CPU overhead
- The first (blue) bar has (QPS for Postgres 11.21 / QPS for MySQL 5.6.21)
- The second (red) bar has (QPS for Postgres 16.0 / QPS for MySQL 8.0.34)