

PostgreSQL or MySQL: Which is faster?


What makes an enterprise-class database? Redundancy and failover capabilities are just two important features that MySQL expert Scott Noyes names. Noyes also tackles the issue of who's faster: PostgreSQL or MySQL. Along the way, he gives some advice for users working with Sybase and MySQL.

More on MySQL:
Ask Scott a Linux database question

Five reasons why you should never use PostgreSQL -- ever

Which is faster: PostgreSQL or MySQL?


What are considered enterprise-class features and, of these, what qualities does MySQL have to offer?

Noyes: Typical enterprise-class features include ACID-compliance, redundancy, automatic failover and very large datasets. MySQL offers all of those features, along with support to help your company configure your servers for optimal performance. See MySQL's offerings for details.

How different is Perl or PHP functionality in MySQL vs. PostgreSQL?

Noyes: This question could mean one of two things. It might be, "How do I write Perl or PHP code that uses a MySQL or PostgreSQL database?" Or, it might be, "Is it possible to write functions and procedures in MySQL and PostgreSQL using Perl or PHP?" For the former, there are a few choices. PHP offers extensions specific to MySQL and to PostgreSQL, so you might write code using mysql_query or pg_query. You can also use PDO or ODBC to connect in a more or less database agnostic manner.

For the latter, PostgreSQL offers PL/Perl and PL/php, which allow you to write procedures in Perl and PHP. PL/Perl is currently more stable than PL/php.

With the aid of some user-defined functions and a thread-safe compilation, it is possible to write functions for MySQL using Perl and PHP. See and for details. It is possible that future versions of MySQL will allow a more "plug and play" approach to coding procedures in other languages.

How can PostgreSQL users connect to ASP?

Noyes: You can connect ASP to PostgreSQL using ADO, ODBC or the .Net interface.

Can tables be imported to Sybase from MySQL?

Noyes: If you stick with SQL standard data types, it should be easy to export the database to SQL statements using mysqldump and executing those in Sybase. There might be some minor modifications necessary, especially if Sybase handles indexes or NULL values a little differently. Advanced features like triggers, sequences, stored procedures and configuration settings are unlikely to port directly between databases.


Dig Deeper on Linux servers