Re: [SLUG] A question of databases

From: Derek Glidden (dglidden@illusionary.com)
Date: Tue Apr 06 2004 - 11:06:28 EDT


On Apr 5, 2004, at 8:52 AM, Ronan Heffernan wrote:

> I have used Postgres extensively in professional projects since 1994,
> and I have used MySQL for some websites (especially to run PostNuke),
> so you can see where my bias might lie. MySQL is supposed to have a
> speed advantage (in case you are doing a lot of processing on a slow
> machine). Postgres has a definite feature advantage (ACID compliant
> transactions, nested subqueries, etc.) I have been very frustrated
> trying to work around some of the missing features in MySQL
> (especially nested sub-queries like: select * from tablea where (id
> not in (select ta_id from table b where active)); ) and would highly
> recommend Postgres for its reliability.

I'm slightly partial to PostgreSQL, but I think they are both great
systems. I'm glad this thread hasn't turned into a "MySQL vs.
PostgreSQL" flame war. :)

MySQL's mission has always been "speed over functionality. If we have
to compromise speed for a function, we probably won't implement it."
At least until recently. I'm not sure if they're still trying to
follow that goal or if they have gone the way of wanting to be a more
complete database as opposed to just plain fast.

Despite MySQL's preference for speed, PostgreSQL 7.3 and 7.4 have
broken most of the speed barriers that used to keep me using MySQL.
PostgreSQL's query analyser/optimizer is pretty darn impressive. Other
than some really, really simple queries (such as "SELECT COUNT(key)
FROM table") that MySQL returns in essentially 0 time, PostgreSQL can
now keep up and often surpasses MySQL in sheer query speed.

A project we were working on at NKS for a while had some really hairy
queries where I was joining up to five tables, (with OUTER joins too)
that could have between thousands to hundreds of thousands of records
in each table. PostgreSQL at times was an order of magnitude or more
faster than MySQL at returning results for these complicated queries.
(On the order of 1.5m for PG to tens of minutes for MySQL.) Sometimes
MySQL would NEVER return a result; apparently it couldn't handle it.
PG 7.4 is even better.

To be fair, on simple queries involving indexed columns, MySQL would
often return results in times that were darn close to 0, where
PostgreSQL could sometimes take tens of seconds.

Depending on the complexity of the type of database work you're doing,
PostgreSQL will probably have a slight advantage. Plus PostgreSQL
implements some ANSI-SQL features not present in MySQL, such as
sequences, that will drive you batty after a while if you're using
MySQL and trying to do anything even moderately complicated.

YMMV

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"We all enter this world in the | Support Electronic Freedom
same way: naked; screaming; soaked | http://www.eff.org/
in blood. But if you live your | http://www.anti-dmca.org/
life right, that kind of thing |---------------------------
doesn't have to stop there." -- Dana Gould

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:13:29 EDT