mysql_vs_postgresql

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: Egon Schmid <eschmid@php.net>
Date: Tue, 04 Jul 2000 21:51:11 +0200

Tim Perdue wrote:
> 
> On wednesday or thursday, I'm going to be publishing my article on MySQL
> vs. Postgres on PHPBuilder.com.

Cool!

> Features:
> Postgres is undoubtedly far, far more advanced than MySQL is. Postgres
> now supports foreign keys, which can help with referential integrity.
> Postgres supports subselects and better support for creating tables as
> the result of queries. The "transaction" support that MySQL lacks is
> included in Postgres, although you'll never miss it on a website, unless
> you're building something for a bank, and if you're doing that, you'll
> use oracle.

Since MySQL version 3.23.16 it supports transactions with sleepycats DB3
and since version 3.23.19 it is under the GPL.

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: Mike Mascari <mascarm@mascari.com>
Date: Wed, 05 Jul 2000 09:06:16 -0400

Peter Galbavy wrote:
> 
> What ? sleepycat DB3 is now GPL ? That would be a change of philosophy.
> 
> Peter

Not to my understanding. If you sell a commercial solution
involving MySQL, you have to pay Sleepycat a licensing fee. For
non-commercial use, its free. Oh, what a tangled web we weave
when we bail from BSD.

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: "Peter Galbavy" <peter.galbavy@knowledge.com>
Date: Wed, 5 Jul 2000 15:55:13 -0000

Yes I'm sure that PHP was designed to make Postgres look bad. All
> benchmarks are designed to make postgres look bad. All web designers
> build everything in just that special way that makes postgres look bad,
> and they all do it because they're inept and stupid, unlike the small
> crowd of postgres users.

I don't believe that your sarcasm is unwarranted, BUT, and this is a big but
(just like mine :), I have found that the popularity of free software is
sometimes inversly proportional to it's complexity. Complexity in turn
sometimes, but not always, implies that the software has more features and
is better thought out. There are exceptions to this, but it has proven true
for many of the packages I have worked with.

MySQL is used by Linux folks (generalising), probably because the learning
curve is not too steep. And the otherway round for other DB + OS
combinations.

The problem I think that many folk have with printed benchmarks is the
apples to oranges comparisons. To make the comparison look valid, you have
to either reduce or ignore the differences of the fruit and just look at a
limited set of values. In the case of the apples and oranges, "average
diameter" may be valid, while "green-ness" is not. The eater of the fruit
actually wanted to know "which tastes better".

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: Thomas Lockhart <lockhart@alumni.caltech.edu>
Date: Wed, 05 Jul 2000 16:03:22 +0000

Yes I'm sure that PHP was designed to make Postgres look bad. All
> benchmarks are designed to make postgres look bad. All web designers
> build everything in just that special way that makes postgres look bad,
> and they all do it because they're inept and stupid, unlike the small
> crowd of postgres users.

Another happy customer... ;)

Tim, one of the apparent "discriminators" between typical MySQL users
and typical Postgres users is their perception of the importance of
transactions and its relevance in application design.

For myself, coming from other commercial databases and having built
large data handling systems using those, doing without transactions is
difficult to accept. And we'd like for others to see the light too.
Hopefully the light will be a bit closer soon, since, apparently,
transactions are coming to the MySQL feature set.

You mentioned a speed difference in Postgres vs MySQL. The anecdotal
reports are quite often in this direction, but we typically see
comparable or better performance with Postgres when we actually look at
the app or benchmark. Would it be possible to see the test case and to
reproduce it here?

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: Benjamin Adida <ben@mit.edu>
Date: Wed, 05 Jul 2000 11:56:45 -0400

on 7/5/00 11:37 AM, Tim Perdue at tperdue@valinux.com wrote:

> ...useless rant about all MySQL users being stupid inept programmers
> deleted....

Hmmm, okay, well, I guess my invitation to continue the conversation while
admitting a difference in assumptions is declined. Yes, my response was
harsh, but harsh on MySQL. I didn't attack MySQL programmers. I attacked the
product.

Is there a way to do this without incurring the wrath of MySQL users? If you
look at the Postgres mailing list, your worries (the duplicate key thing)
were addressed immediately by Postgres programmers, because they (the
Postgres team, which *doesn't* include me) understand the need to improve
the product.

And no, benchmarks aren't built to make Postgres look bad. But PHP is built
around an inefficient connection pooling system, which doesn't appear much
under MySQL because MySQL has extremely fast connection setup, while every
other RDBMS on the market (Oracle, Sybase, Informix, Postgres) does not.
That's the cost of setting up a transaction environment, it takes a bit of
time. Thus, PHP's pconnect() crushes performance on all databases except
MySQL.

But anyhow, I've clearly hit a nerve. You asked a question, I answered
truthfully, honestly, and logically. And you're absolutely right that I come
out strongly against MySQL. Proceed with this information as you see fit...

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: Hannu Krosing <hannu@tm.ee>
Date: Wed, 05 Jul 2000 18:13:02 +0300

Tim Perdue wrote:
> 
> Benjamin Adida wrote:
> 
> ...useless rant about all MySQL users being stupid inept programmers
> deleted....
> 
> > PHP folks have a bias, too: PHP was built with MySQL in mind, it even ships
> > with MySQL drivers (and not Postgres). PHP's mediocre connection pooling
> > limits Postgres performance.
> 
> Well the point of this article is obviously in relation to PHP. Yes,
> Rasmus Lerdorf himself uses MySQL and I'm sure Jan would say he's a
> "wannabee", not a "real developer".

Rather he is probably a _web_ developer and not a _database_ developer, as 
most developers with DB background abhor lack of transactions, as you have 
surely noticed by now, and would not use MySQL fro R/W access ;)

> Yes I'm sure that PHP was designed to make Postgres look bad. All
> benchmarks are designed to make postgres look bad. All web designers
> build everything in just that special way that makes postgres look bad,
> and they all do it because they're inept and stupid,

Or just irresponsible. 

That's how most websites grow -
 at first no writes - MySQL is great (a filesystem with SQL interface
performance-wize)
 then some writes in real time, when popularity grows bad things start to
happen.
 then delayed writes a la Slashdot to keep the performance and integrity of
database.

> unlike the small crowd of postgres users.

That could be part of the problem ;)

SQL is a complex beast and a programmer experienced in procedural languages 
takes some time to learn to use it effectively. Until then he just tries to 
use his C/Pascal/java/whatever knowledge and simple selects - and this is
where MySQL excels.

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: Sevo Stille <sevo@ip23.net>
Date: Wed, 05 Jul 2000 18:13:51 +0200

The Hermit Hacker wrote:

> We had a *very* old version of PostgreSQL running on a Pentium acting as
> an accounting/authentication backend to a RADIUS server for an ISP
> ... uptime for the server itself was *almost* 365 days (someone hit the
> power switch by accident, meaning to power down a different machine
> *sigh*) ... PostgreSQL server had been up for something like 6 months
> without any problems, with the previous downtime being to upgrade the
> server ...

At a previous employer, there is still a database running that has not
seen a crash downtime ever since early 1996 - the only few downtimes it
ever saw were for a rare few postgres, OS and hardware upgrades. As
there have been no cries for help on any database or reboot issue ever
since I left (I still am appointed as the DB admin in case of any
trouble), it must be getting close to two years uptime by now, and that
literally unattended. 

Sevo

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: Tim Perdue <tperdue@valinux.com>
Date: Wed, 05 Jul 2000 09:34:05 -0700

Thomas Lockhart wrote:
> You mentioned a speed difference in Postgres vs MySQL. The anecdotal
> reports are quite often in this direction, but we typically see
> comparable or better performance with Postgres when we actually look at
> the app or benchmark. Would it be possible to see the test case and to
> reproduce it here?

Finally a sensible reply from one of the core guys.

http://www.perdue.net/benchmarks.tar.gz

To switch between postgres and mysql, copy postgres.php to database.php,
change the line of SQL with the LIMIT statement in forum.php. 

To move to mysql, copy mysql.php to database.php and change the line of
SQL in forum.php

No bitching about the "bad design" of the forum using recursion to show
submessages. It can be done in memory in PHP, but I chose to hit the
database instead. This page is a good example of one that hits the
database hard. It's one of the worst on our site.

At any rate, I wish someone would write an article that explains what
the benefits of transactions are, and how to use them effectively in a
web app, skipping the religious fervor surrounding pgsql vs. myql.
There's a lot of people visiting PHPBuilder who just want to expand
their knowledge of web development, and many of them would find that
interesting.

Tim

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: The Hermit Hacker <scrappy@hub.org>
Date: Wed, 5 Jul 2000 13:30:51 -0300 (ADT)

On Wed, 5 Jul 2000, Benjamin Adida wrote:

> > Another clarification: PHPBuilder is owned by internet.com, a competitor
> > of VA Linux/Andover.
> 
> PHP folks have a bias, too: PHP was built with MySQL in mind, it even ships
> with MySQL drivers (and not Postgres). PHP's mediocre connection pooling
> limits Postgres performance.

Careful here ... PHP was not built with MySQL in mind ... hell, I used PHP
ages before it even *had* MySQL support (hell, before I even know about
Postgres95 *or* MySQL) ... also, if I recall reading on the PHP site, the
MySQL support that is included is limited, but I don't recall where I read
it.  There is a recommendation *somewhere* that if you want to use all the
features, you ahve to install the MySQL libraries first ...

Just to defend PHP, cause, well ... I like it :)

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: The Hermit Hacker <scrappy@hub.org>
Date: Wed, 5 Jul 2000 13:35:16 -0300 (ADT)

On Wed, 5 Jul 2000, Tim Perdue wrote:

> Benjamin Adida wrote:
> 
> ...useless rant about all MySQL users being stupid inept programmers
> deleted....
> 
> 
> > PHP folks have a bias, too: PHP was built with MySQL in mind, it even ships
> > with MySQL drivers (and not Postgres). PHP's mediocre connection pooling
> > limits Postgres performance.
> 
> Well the point of this article is obviously in relation to PHP. Yes,
> Rasmus Lerdorf himself uses MySQL and I'm sure Jan would say he's a
> "wannabee", not a "real developer". 

I would seriously doubt that Jan wuld consider Rasmus a 'wannabee'
... Rasmus essentially built a Web optimized, HTML embedded language that
I imagine a *large* percentage of the sites on the 'Net rely on.  My
experience with the language is that it is clean and *very* easy to pick
up for simple stuff, with some nice, advanced tools for the more complex
issues ...

I use PHP with PgSQL almost exclusively now for my frontends, since its
got some *nice* features for retrieving the results of queries (ie. I love
being able to do a SELECT * and being able to retrive the results by the
field name instead of having to know the ordering) ...

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: Benjamin Adida <ben@mit.edu>
Date: Wed, 05 Jul 2000 12:43:05 -0400

Tim,

I'm sorry if I came off harsh in my previous comments. I'm a fervent
supporter of open-source software, and have hit massive pushback from
enterprise people because they see all the open-source sites using MySQL,
and that is outrageous to them. Although MySQL has a few, important niches
to fill, it's been used in places where I think it's hurt the credibility of
open-source web developers. I've been trying to talk to MySQL
developer/users about how we got to where we are, but with little success
(and what I've told you is by far the nastiest I've ever been in this
respect).

I hope that we can have a meaningful exchange about these issues. I'm a fan
of Postgres, but by no means a religious supporter of it. I *am* a religious
supporter of transactions, subselects, and such.

If you'd like to find out more about transactions, you can check out Philip
Greenspun's http://www.arsdigita.com/asj/aolserver/introduction-2.html which
has a paragraph about "Why Oracle?" which explains the reasons for choosing
an ACID-compliant RDBMS.

I'm also happy to write up a "why transactions are good" article.

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: Tim Perdue <tperdue@valinux.com>
Date: Wed, 05 Jul 2000 10:00:39 -0700

The Hermit Hacker wrote:
> 
> Will you accept modifications to this if submit'd, to make better use of
> features that PostgreSQL has to improve performance?  Just downloaded it
> and am going to look her through, just wondering if it would be a waste of
> time for me to suggest changes though :)

If you can figure out an algorithm that shows these nested messages more
efficiently on postgres, then that would be a pretty compelling reason
to move SourceForge to Postgres instead of MySQL, which is totally
reaching its limits on our site. Right now, neither database appears
like it will work, so Oracle is starting to loom on the horizon.

===

Subject: Re: [HACKERS] Article on MySQL vs. Postgres
From: JanWieck@t-online.de (Jan Wieck)
Date: Wed, 5 Jul 2000 20:01:54 +0200 (MEST)

The Hermit Hacker wrote:
> On Wed, 5 Jul 2000, Tim Perdue wrote:
>
> > Benjamin Adida wrote:
> >
> > ...useless rant about all MySQL users being stupid inept programmers
> > deleted....
> >
> >
> > > PHP folks have a bias, too: PHP was built with MySQL in mind, it even ships
> > > with MySQL drivers (and not Postgres). PHP's mediocre connection pooling
> > > limits Postgres performance.
> >
> > Well the point of this article is obviously in relation to PHP. Yes,
> > Rasmus Lerdorf himself uses MySQL and I'm sure Jan would say he's a
> > "wannabee", not a "real developer".
>
> I would seriously doubt that Jan wuld consider Rasmus a 'wannabee'
> .... Rasmus essentially built a Web optimized, HTML embedded language that
> I imagine a *large* percentage of the sites ...

    NEVER!

    Once  I've built a PG based middle tear with an apache module
    that could in cooperation be a complete virtual  host  inside
    of  a DB. Including inbound Tcl scripting, DB-access, dynamic
    images and whatnot. Never finished that work until AOL-Server
    3.0   appeared,  at  which  point  I  considered  my  product
    "trashwork".

    Some of the sources I looked at (and learned alot  from)  was
    the PHP module. So I know what kind of programmer built that.

    Maybe someone of the PG  community  should  spend  some  time
    building  a  better  PHP  coupling  and  contribute  to  that
    project. And there are more such projects  out  that  need  a
    helping hand from our side.

===




the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu