PostgreSQL vs MySQL benchmark

Pushed by the latest news about MySQL stopping to provide Windows binaries and the split between a community edition and a enterprise server I started to look for other options. The first one is without doubt PostgreSQL. The first things you will hear about PostgreSQL is that it is technically superior to MySQL – and this is true – but way slower. There are few side by side benchmarks to be found so I thought to check the second statement using latest available versions.


The results are from a TPC-C like benchmark (”it combines read-only and update intensive transactions simulating the activities found in complex OLTP enterprise environments”). I used MySQL 5.0.27 (innodb) and PostgreSQL 8.2.1 with comparable memory and disc settings. Database size is about 80MB for each test (5000 – 300000 rows/table) and the number of concurrent users ranges from 1 to 20. I think this is a good testing scenario but if you have suggestions or other results please comment. Here are the results (500MHz PIII, 256 MB RAM, 2 IDE HDDs – client on different computer, 100MB/s network):

Transactions/second (MySQL, PostgreSQL)

Transaction graph MySQL
Transaction graph PostgreSQL
Timeout errors MySQL
Timeout errors PostgreSQL

Conclusions:

  • PostgreSQL was slower at populating the database.
  • MySQL is faster overall overall (~2x faster).
  • No timeout errors for PostgreSQL. Interesting.
  • Maybe there is more room for improvements in PostgreSQL config file.

More links on the subject:
http://monstera.man.poznan.pl/wiki/index.php/Mysql_vs_postgres
http://www.mysqlperformanceblog.com/2006/11/30/interesting-mysql-and-postgresql-benchmarks/
http://tweakers.net/reviews/657/6
http://tweakers.net/reviews/649/9
http://benchw.sourceforge.net/benchw_results_open3.html
http://www-css.fnal.gov/dsg/external/freeware/pgsql-vs-mysql.htm

Leave a Reply

You must be logged in to post a comment.