Mysql – Postgresql vs. MySQL: how do their data sizes compare to each other

MySQLpostgresqlstorage

For the same data set, with mostly text data, how do the data (table + index) size of Postgresql compared to that of MySQL?

  • Postgresql uses MVCC, that would suggest its data size would be bigger

  • In this presentation, the largest blog site in Japan talked about their migration from Postgresql to MySQL. One of their reasons for moving away from Postgresql was that data size in Postgresql was too large (p. 41):
    Migrating from PostgreSQL to MySQL at Cocolog, Japan's Largest Blog Community

  • Postgresql has data compression, so that should make the data size smaller. But MySQL Plugin also has compression.

Does anyone have any actual experience about how the data sizes of Postgresql & MySQL compare to each other?

Best Answer

MySQL does use MVCC if your tables are in InnoDB format, which they should be unless you have a specific reason to use MyISAM. There are pros and cons for both. If your primary concern is data-size, MySQL offers several plugins, one of which is compressed MyISAM tables, which can make the data-size very small.

When picking one or the other, you should examine your complete use case before making a selection. Data-size is one factor, but it really depends on your usage. If it's for a web-based service of sorts, MySQL is usually a good candidate as it performs well with read-intensive workloads (which most websites are). MySQL also supports replication inherently (albeit asynchronously). If it's something more specific, Postgres may be a better option.

You should also take a close look at Percona's MySQL Server (http://www.percona.com/software/percona-server/). It's based off MySQL and offers a HUGE performance improvement over the standard MySQL builds. It's very well supported and constantly being improved. My feeling is that Percona MySQL Server will probably meet your requirements.

Hope this helps!