GuidesPHPBuilder: MySQL and PostgreSQL Compared

PHPBuilder: MySQL and PostgreSQL Compared




“Which database do I use: Postgres or MySQL? This age-old question has
plagued developers for, what, at least a couple years now. I’ve used both
databases extensively (MySQL for about one year and Postgres for about 2
years) and was curious if the performance differences between the two were
as stark as the MySQL website suggests.”

This time around, rather than using some contrived benchmarking scheme, I wanted to grab a real life web page from a real web site and see
how it performed on the two databases. The page in question was the discussion forum on SourceForge. It involves some relatively straightforward
joins of three tables, each with 20-30,000 rows of data. It also involves some recursive queries to show nested messages, so the database is the true
bottleneck on this page, not PHP.

“I had actually benchmarked the two databases back in September 1999 when
we were starting to lay the groundwork for SourceForge. At the time, the
performance difference was so stark that we had to go with MySQL even though I had always used
Postgres for all my work. The rest of the developers were used to MySQL and that pretty much
cinched the decision. “

“This time around, rather than using some contrived benchmarking scheme, I wanted to grab a
“real life” web page from a “real” web site and see how it performed on the two databases. The
page in question was the discussion forum on SourceForge. It involves some relatively
straightforward joins of three tables, each with 20-30,000 rows of data. It also involves some
recursive queries to show nested messages, so the database is the true bottleneck on this page, not
PHP.”

Latest Posts

Related Stories