PostgreSQL vs. MySQL comparison
prostoalex writes "Ever find yourself wondering which open source database is the best tool for the job? Well, wonder no more, and let your tax dollars do the work in the form of Fermi National Accelerator Laboratory publishing this unbiased review of MySQL vs. PostgreSQL. After reading it, however, it seems that MySQL ranks the same or better on most of the accounts." My poor sleepy eyes misread the date of posting on here; caveat that this is more then 15 months old.
From TFA:
Foreign keys are nice, I have to say; I implement them in mysql anyway, in spite of the fact that they're ignored for MyISAM.
1. There's no such thing as unbiased. Especially on a page that gives a fairly abstract review.
2. This article is 2 years old. Everything in its comparisons is out of date.
Javascript + Nintendo DSi = DSiCade
MySQL as good? You mean besides the weird MySQL-proprietary SQL stuff and the data integrity?
From the site:
"Last modified: February 15, 2005."
MySQL does not have tablespaces, only recently support for views, subselects, transactions was added and triggers and stored procedures are still considered alpha. No bitmap indexes... This is by far not the best comparison I've ever seen.
Having foreign keys, views, subselects, and transactions can all be very attractive in PostgreSql -
if you need them and you will make any use of them. If you don't need them or won't use them, then
you're probably better off with MySQL and its superior performance.
PostgreSql is more stable than MySQL, (and has better performance when saturated), shouldn't you take that into consideration?
thank God the internet isn't a human right.
postgresql has a native Win32 version, complete with an installer, service support and does not depend on cygwin.
PostgreSQL seems to be a more "professional" database. Speed isn't everything, check on the article things like DATA INTEGRITY, SPECIAL server-side FEATURES, LOCKING and CONCURRENCY SUPPORT or LARGE OBJECTS.
I choose PostgreSQL for my applications.
ajf
Just take a look at the description per item. I couldn't possibly call this unbiased in any way.
Look at the bottom of the page "Last modified: February 15, 2005."
I didn't even get to the second item and found information that isn't valid. PostgreSQL installs and runs as service on Windows out of the box (not that I recommend running anything on Windows if you can help it).
Surely, given the speed that these suites tend to be developed, this comparison is tragically out of date by now? There were a few pieces of comparison which gave the impression that it needed to be updated ("Expect PostgreSQL 8.x to continue this trend."), and I'm fairly sure that both systems have advanced considerably in most, if not all, of the criteria specified.
who said everything done by the government needs to be unbiased? this isn't the court or the elections or something, this is them deciding on a piece of software to use. for a little crap decision like this they should pick whatever makes them most comfortable and crank out the data everyone wants.
i think mysql is better because of the name... "post-greeeeee-SQL" sounds awful.
I have been involved with a smallish ("hundreds") installation of Movable Type using a mysql backend.
One comment spammer can completely annihilate it.
One developer I talked to once did some testing. On one simultaneous connection, mysql was way faster. By five or so, they were close. At ten, PostgreSQL was definitely winning. At a hundred, he was simply unable to get a single MySQL server to complete the test successfully, let alone do it quickly.
The impression I get is that PostgreSQL uses more robust algorithms, with higher constant costs and lower quadratic costs. In any event, never had any problems.
As noted elsewhere, these comparisons are quite old...
But in any event, in my own experience, mysql is a lot easier to blow up by overloading than postgres is, at least if you have a lot of writes going on. For pure-lookup functions, it might do better -- but a lot of modern database apps are pretty compulsive about saving at least something every time someone touches them. (For instance, modern vBulletin saves last visits, threads seen, and so on; all of that adds up to a huge load on the database server.)
My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
And what is the next category?
Which says:
Why is "Runs on countless platforms" an item under "SQL standard COMPLIANCE" when "PLATFORMS" is also a category?
It looks as if the "reviewer" was trying to bulk up MySQL's characteristics. Even when it was totally inappropriate. A checklist of features would be more accurate in this case. With some evaluation of how well those features are implemented.
Glad to see the comparison, but I would really like to see is a comparison that includes the new 2.0 release of Firebird. Their new release is impressive, but I dont know how the features pan out with MySQL or Postgres. Including Derby would also be nice.
The most important factor to me in any comparison is the licensing agreement. I like a very open agreement and the MySQL license requires you to release the source code to your product in some cases, or you have to purchase a license from them.
You have to give the MySQL guys credit for the fact that it is an incredibly easy product when it comes to configuring it for your needs. For me, out of college, going to Oracle was a culture shock because the process of configuring Oracle was so convoluted and drawn out for simple stuff. I know that Oracle and PostgreSQL can be much more powerful than MySQL, but there is something to be said for how easy it is for a developer to install MySQL and just start working with it.
The article is dated Feb 15, 2005.
Since then things have changed a lot, especially regarding Win32 service support, ALTER TABLE features, stability and security.
I suggest we scrap this post altogether
1 -- This article is years old.
2 -- This article is posted solely to stir up (repetitive) discussion.
3 -- This article pretends that MySQL is a real database, even though in order to do so it has to make gigantic leaps like considering data integrity to be not really all that important in a database.
4 -- This article trolled me.
Whence? Hence. Whither? Thither.
I'd rather have a new (not THAT old) comparison between Oracle and MySQL
It's been a long time since any of their PostgreSQL statements were true. It's a very happy native windows service with a nice installer, and the administrative interface is very easy to use. Let's try posting current reviews of software, rather than reruns from a year or two ago.
Easy Online Role Playing Campaign Management
Main reasons:
1. Very strict about data integrity. Entering "sdf" into a date field will throw an error in PostgreSQL, while MySQL (even in strict mode) will corrupt it to "0000-00-00" (v5 does throw an error, but it still enters the corrupt data).
2. Mature support for foreign keys. If you do not understand the concept, get the fuck away from a database.
3. Mature support for stored procedures.
4. Mature support for views.
5. Mature support for triggers.
I can't believe they even let this post survive. It's old, and it simply isn't fair for either platform's updates and new features. Just delete this crap...
February 15, 2005
My karma is not a Chameleon.
MySQL speed will really depend on the database engine you use (MyISAM or InnoDB do not perform the same!). PostgreSQL performance is pretty much consistent across platforms.
On the HA side, PostgreSQL has maybe less options: Slony/I (http://gborg.postgresql.org/project/slony1/) for master/slave or Sequoia (http://sequoia.continuent.org/) for multi-master.o n.html) for master/slave, MySQL cluster (http://dev.mysql.com/doc/refman/5.0/en/mysql-clus ter.html) for those who want to switch to a new storage engine (NDB) or Sequoia (URL:http://sequoia.continuent.org/) for multi-master with transparent failover.
MySQL offers MySQL replication (http://dev.mysql.com/doc/refman/5.0/en/replicati
I know slashdot is for nerds (and I happen to use mysql databases myself), but honestly - an old article comparing databases? Must... keep... eyelids.. open...
biopowered.co.uk - catalytically cracking triglycerides for home automotive use since 2008. Just say no to big oil!
You don't need to setup anything to run it for the first time, only if you want to play with performance, you can start to modify parameters as memory, max connections, etc. PostgreSQL is easy and powerful, just give it a try.
ajf
I call pure, unadulterated crap on this one.
One of the major new features in Postgresql 8 was native Windows support. It runs just fine as a service.
This comparision is either very old news, incompetence in action, or, um! strongly biased.
ich bin der musikant
mit taschenrechner in der hand
kraftwerk
Out of LAMP, the only component that doesn't suck goats is Apache. Linux is a total mess (2.6 is unstable to the point of being useless), MySQL can barely be called a database (absolutely key functionality missing, error reporting extremely weak) and PHP is a security joke (unless you add in Suhosin).
The low entry bar to PHP coding and the fact that most of the bargain bin webhosts offer a poorly configured MySQL install as part of a $1/mnth plan only serves to perpetuate this horrid combination of software. What is worse is the way in which it has seeped into corporate applications. I hate you all.
This almost seems like the same comparisons we've been hearing for years.
1) Postgresql is more full featured than MySQL
2) MySQL is faster in a read-mostly environment
That's pretty much the same as the anecdotal arguments have been for years.
In my job, we moved from mysql to postgres several years ago (around PG 7.0). At the time, we needed to make the move for performance reasons. We are in a read-write system, and MySQL's locking was killing us (this was before InnoDB was well established). The features are better too, as our developers were used to having data integrity features, server side programming, and all of the SQL92 constructs available. We also learned a bit about PG performance, which I'll share.
1) Run EXPLAIN ANALYZE on everything. Postgresql is touchier about query performance than MySQL was. This just needs to be a habit if you're using PG. (You really should do performance analysis no matter your DB. It's just a good practice). The biggest gain will be making sure you're using index scans rather than sequential scans.
2) Use persistent connections. Everyone likes to point out the forking issue with PG vs. MySQL's threaded. PG's connection handling is slow, there's no doubt about it. But there's an easy answer. Just limit how often you connect. If you can keep a connection pool, and just reuse those connections, you'll save this big hit.
3) Full vacuum and reindex regularly. We've found the docs to be a bit off on this. It indicates that you should run these occasionally. If you're in a read-write system, a full vacuum on a regular basis is very important. It really doesn't take that long if you do it regularly. Also, we've had trouble with indexes getting unbalanced (we see 50->90% tuple turnover daily). This has gotten better, but it doesn't hurt to let your maintenance scripts make things ideal for you. So, we run a full vacuum and reindex of our tables nightly through cron.
4) Get your shared memory right. PG's shared buffers is probably the most important config attribute. It controls how much of your DB is memory resident vs disk resident. Avoiding disk hits is a big deal for any DB, so get this right. If you can fit your whole DB in memory, then do it. If not, make sure your primary tables will fit. The more you use the shared memory, and the less you have to page data in/out, the better your overall performance will be.
Most DB systems seem to be read-mostly, so I can understand the performance comparisons focusing on that. In our read-write system though, the locking was the biggest issue and it tilted the performance comparison toward PG.
MySQL/MyISAM is the one with the massive legacy code base, the one that your open-source blogging software uses and probably the one that your web host supports. It beautifully hits the "sweet spot" for data-driven web sites with infrequent and simple updates, where trading integrity for "read only" performance is sensible. It does not even purport to compete with PostgreSQL on features - but it does offer fulltext searches, again
MySQL/InnoDB is the one that offers transactions, foreign keys etc. (ISTR it doesn't do fulltext indexes, though) - this is the "version" that bears comparison with PostgreSQL. I wonder how its user base compares?
(OK - you can mix InnoDB and MyISAM tables in a single database, but you can't use InnoDB if your web host hasn't installed it - heck, one provider I use is still on MySQL V3.23)
Flamewars have tended to pit PostgreSQL against a mythical database with the performance of MyISAM and the features of InnoDB...
As for the GUI software, the MySQL GUI Admin/query browser stuff is shinier than PgAdmin3 - but the MacOS version of the former is a complete crashfest! Neither of them steps up to the plate of providing a FOSS equivalent of (the good bits) of MS Access.
In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
" let your tax dollars do the work in the form of Fermi National Accelerator Laboratory"
I don''t begrudge the world the science (and other investigations) that Americans pay for. But that summary should read "let US tax dollars do the work".
I wonder how many of Slashdot's foreign readers who usually rail against US-centric language in posts here will complain about how they get a free ride on this research.
--
make install -not war
Seeing the current rate of development of both MySQL and PostgreSQL
this can only be a bad joke...
Ok, this is yet another outdated report comparing three mainstream RDBMS'es - MySQL, PostgreSQL and ORACLE. It was done for yet another physical experiment - for choosing the proper system for storing data about the construction process of one of the LHC detectors - ALICE.y k/db_compare/db_compare.html
And this report is at least professional, which cannot be said about the one mentioned in the article.
http://dcdbappl1.cern.ch:8080/dcdb/archive/ttracz
http://tweakers.net/reviews/657
They compare PostgreSQL 8.2 vs MySQL 4.1.20 and MySQL 5.1.20a.
Interactive Visual Medical Dictionary
More nice "editing" from Slashdot "editors". Or are they bots?
If you want news from today, you have to come back tomorrow.
I did a presentation at the Atlanta Unix Users' Group this month that is a more up-to-date comparison. It's available in Open Office format. You can also get to it from my home page. I did a similar talk almost four years ago. My conclusion is that MySQL has closed the feature gap with PostgreSQL in recent years. I still give PostgreSQL the edge in features, and MySQL the edge in out-of-the-box untuned performance. I also discuss replication and clustering.
Why MySQL? it's not in the same league at all. If you are in the market for Oracle, you definitely are not in the market for mySQL.
Oracle vs PostgreSQL would make a lot more sense. 8 series of course.
I've worked with MySQL replication for about three years and I'd have to say that feature isn't quite done. Some of the most annoying features:
- Manual cleanup of binary change files is sometimes required.
- Databases in "slave" mode can still be updated by local applications; you can't configure them to only log changes from the "master" database.
- Automated master-slave role-switching requires you to write some code.
- The whole "master/slave" terminology. I know it's meant as just computer-speak and the MySQL team is European, but I work in America; it can be offensive in some situations.
MySQL clustering is also only available for a few of the OSs regular MySQL supports; it's not a universal option for all platforms.
I hate it when people misspell/misuse these words.
Old article and old information. It's almost 2007. That "head-to-head" was done in early 2005. Pre-MySQL5.
Thats the real comparison. I had a 386 dx at 33 mhz where as my unenlightened friend had a 486 sx at 25 mhz. On win 3.11 most benchmarks ( that I wrote) preferred the higher mhz of the 386. While were at it we should also compare the 486 dx at 75 mHZ vs a pentium I at 66 mhz.
Here's a comprehensive performance review between PostgreSQL and MySQL. It compares both DB's under load as well as comparing Intel/AMD chips. http://tweakers.net/reviews/657/6
MySQL is not free for commercial use. This is often forgotten/unknown (I think many use it commercially without paying really because they don't know).
Also is quite a difference to take into account.
This story comes from the it's-been-slow-at-slashdot-lately-lets-stir-things -up-a-bit Dept.
I had to make a decision recently between Mysql and Postgresql for a database composed of many tables with greater than 50,000,000 rows. While going through the decision making process, I loaded a sample table with 50,000,000 rows to do some benchmarks. The first thing I had to do to run my tests was index the table. I started with Mysql using a InnoDB table type. I had both database servers relatively tuned to the hardware they were running on. I ran the create index with MySQL and detached my screen session. I came back several hours later to find MySQL was doing something along the lines of INDEX via REPAIR SORT. After some reading, I learned that this takes an order of magnitude longer than building an index the "normal" way and is caused by the index becoming corrupted during the creation. Okay... so, I restarted this process several times and encountered the same problem. This is clean data mind you that has already been exported from an existing SQL server. I duplicated my install on a second server and had the same problems. Very annoyed with MySQL, I gave Postgres a try. It worked on the first time in less than 25 minutes without issue. Since then I've been using it on 250,000,000 row datasets without issue. It's always reliable, and as long as you remember to use CURSORS for huge SELECT statement, it's painless to work with.
A musician without the RIAA, is like a fish without a bicycle.
The first screen that it says MySQL supports ODBC and doesn't mention that PostgreSQL does as well -- so why should I read further? Either sloppy, ignorant, or biased writing.
There were a couple comparisons a couple years ago. It was my understanding that PostgreSQL did better with large data sets in a P vs. M match. In getting hammered with connections, another test between MySQL, PostgreSQL, DB2, Oracle, and SQLServer, if I remember, Microsoft's offering started to crap out along a power curve at maybe just 200(?) hits and the others degraded pretty equally along a straight line.
My client/server experience started with some Oracle classes and managing a department server. I must say I am _much_ more comfortable with PostgreSQL and find MySQL a little alien no matter how popular it is. Just my 2 cents.
Wow... it's been months since I found anything really useful on /. The article was good, if out of date, because it gave categories of comparison. The comments for the most part were also very helpful because they point out what has changed and bring a bit more real world experience to the debate.
:)
Thanks for the early Christmas present
There is a very good GUI-based admin tool for both PostgreSQL and, recently, MySQL. Its PG Lightning Admin. Unfortunately, it only runs on Windows. But the price can't be beat and is well worth it - especially now that they are running a Holiday Sale.
"If you have no enemies, you have no character" -- Paul Newman
From the comparison table:
These statements convey the same information but that the author has presented them in different lights suggests to me a premeditated bias in favour of MySQL.
From TFA: "To choose between the two databases, you need to understand whether you need the transaction
support of Postgres or the large-text-area support in MySQL.", HUH? Postgresql text can support up over 1G of text per field. Also the article says that BLOBS are "special" in PG and MySQL they are "are just fields in the table", again in accurate at best. PG does have the concept of BLOBS and they are special, but this is really just legacy, most people use bytea which is a binary data type that "are just fields in the table" like in MySQL, this isn't new, it's been around a long time.
However, for many (most?) cases, Oracle is also HUGE OVERKILL!
Does anyone know of a reasonably un-emotional, but still somewhat accurate comparison between PostgreSQL and Oracle? When is it appropriate to use one vs. the other?
Your Servant, B. Baggins
Does the Internet's favorite DBMS have an IP address datatype yet?
How about MAC address? CIDR block?
"An IP address is just a 32-bit unsigned int, duh. Any DBMS can store those."
Wrong. A datatype isn't just about storage, but also about operations. In PostgreSQL, when you do a SELECT across a table with IP addresses in it, you get them formatted and displayed as IP addresses, not as opaque ints. Likewise with CIDR blocks, like "192.168.42.0/23". There's also a comparison operator for asking whether an IP address is within a CIDR block.
If you're implementing a network registration system or an incident logging system, how much of your time do you want to waste staring at opaque ints like 3232246272 rather than IP addresses like 192.168.42.0 when you're trying to debug it?
MySQL is a bimbo, a fratboy: it's easy, but so shallow! The amount of time you save in one-time setup, you will lose many times over in all the little annoyances and deficiencies of a DBMS that was originally designed by folks who didn't really believe in DBMSes. Over time they've slowly been shamed into including many of the features they used to despise: transactions, relational integrity checks, and so on. But there's still so much missing ... not just essential integrity features, but little fiddly bits like good datatype support, the kinds of things that make your life easier (as a programmer or as a DBA) in the long run.
Oracle has an "eXpress Edition", which they say is free to use, even in commercial deployments. (Make sure you read the license yourself, as I'm not even close to being a lawyer!) I've used it for some development work, and it seems to work nicely. It's a bit crippled when it comes to the usual fine-tuning options, but most normal Oracle tools will talk to it. The one gotcha that I overlooked at first is that it has a cap on overall user data size of something like 4 or 5Gig, so you have to think about how much data you're going to be handling. (In other words, it's not something to replace a full-blown enterprise Oracle installation, but it's great for smaller applications.)
So, in this case, it is possible that MySQL would end up being more expensive than Oracle!
Oh, and of course, it's all proprietary software, so if you want a full FOSS stack, you're not going to find it there.
Your Servant, B. Baggins
I think the pentium 60 mhz was considered about the same as the 100 mhz 486s that came out at the end of the 486 days.. except for dividing floating point numbers of course..
I only recently decommisioned a P60 box that was router in favor of a much more efficient WRT box. Too bad that 286 in the closet I can't possibly conceive a use for anymore...
XML is like violence. If it doesn't solve the problem, use more.
I remember the labs on campus, and I did my best to get seated in front of one of the very few 486 DX/4 100's. Those machines were rockets compared to the others. Little did anyone else know. Even when the lab got some P60, I think I preferred the 486 DX/4 100.
I only post comments when someone on the internet is wrong.
...antique article to appear.
I am an admitted MySQL fan, however this "unbiased review" is dripping with subjective statements favoring MySQL.
When you have PostgreSQL criticisms IN MySQL feature sets, it's clearly biased.
Often wrong but never in doubt.
I am Jack9.
Everyone knows me.
How about an article on that neat analysis framework Fermi (and others) use for the terabytes of data they generate and have to sift through?
http://root.cern.ch/ (large scale repository for data analysis)
And how would you use Postgres for something like that anyway? Maybe something like:
http://www.greenplum.com/ (biggy-sized Postgres based data warehousing)
Hey, MySQL fanboy. You don't know what you are talking about.
MySQL doesn't have the same capabilities and flexibilities of stored procedures and triggers as PostgreSQL has. But then again, MySQL only added it recently.
PostgreSQL is a better database in the classical sense of a database. MySQL has better support for cross-database (same server) selects, inserts, etc.. Better, more fine grained permissions.
If one were to compare databases to OSes, PostgreSQL is the UNIX of the databases. Follows standards, like UNIX follows POSIX. MySQL is like Windows of the databases. It doesn't follow standards. Features are added as "one sees fit". MySQL is a more adhoc database.
Which one is better? Use the one that fits your workload!! The comparisons are as useless as comparing if Windows is better than UNIX.
The only comparison is that PostgreSQL is BSD license so you can use it in a commercial app. MySQL has a GPL license so you CANNOT use it without paying MySQL tax for development of your apps (non-GPL apps)!! This makes MySQL more expensive to develop for than Oracle, MSSQL or DB2 all of which are free for development. Therefore, for a commercial app developer, the cost of supporting databases is,
PostgreSQL + Oracle + MSSQL + DB2 < MySQL
Sad but true. As for free usage, MySQL cost is the same (free) as the following databases,
PostgreSQL, Oracle Express, MSSQL Express, DB2 Express
The "Express" editions are limited to about a GB ram and 4 GB data, or something like that. So these will work just fine for websites and other small stuff.
Not only does the language seem to show a bias towards MySQL, there is no depth to this. For example, SQL isn't all that huge---they lack a listing of specific differences of SQL with the standard for each database system. If you're looking for something to help you decide which database you're going to use, this article is useless.
i was using pgsql 8.x back in 2005 - so it existed. they just cherry picked versions to get the result they wanted. postgresql.org linked to a new study where both current versions (at the time, and it was recent - pgsql is 8.2 now) of mysql and postgresql were put throught the paces... http://www.postgresql.org/about/news.691
One of the biggest issues in my mind is MySQLs lack of Kerberos support. With PostgreSQL you can authenticate web clients using Kebreros, export the KRB5CCNAME environment variable, call pgsql_connect and voila it just works. Single Sign On (SSO) is a critical requirement on big IntrAnets now. MySQL will never be anything but the local Linux guy's pet project if it doesn't get around to supporting GSSAPI.
I particularly enjoy this for cHELL. Well, I sure hope you never work on anything serious.
The database's function is to provide a RELIABLE storage for your data. Part of the whole reliability thing is making sure crap can't get in, because once it's there everything goes to HELL.
For instance, let's take a shopping cart. Can an order be for a negative quantity? If your app doesn't work that way (it could, using a negative amount for returns for example), and you still allow it in the DB, then all your reporting goes to HELL, as SELECT SUM... now returns the wrong thing.
A proper database is set up in such a way that every piece of data in it makese sense. This means for instance not having things like orders hanging around without in the void without being linked to some client. This is something easily ensured by foreign keys. Otherwise you have an utter mess - the total of the orders in the database doesn't match the sum of the orders of all clients!
If you put your cHELLs in the database, you have a guarantee that when somebody else codes another frontend to it (say, you had a website and now are making a special version for PDAs), if the application does the wrong thing, the database simply won't let it happen. This may cost a bit of speed, but I assure you that peace, your sanity and your ASS (if you have a boss and he's got any sense, he's not going to like it at ALL if it turns out that reports don't match reality, and that reality can't be even easily extracted) is far, far more valuable.
[
Else then that I have my dream come true enterprise database with the added bones of a size, which is 5% from a Sybase installation. Let alone Oracle :)
ich bin der musikant
mit taschenrechner in der hand
kraftwerk
...this is not. A cursory read is all that's necessary to notice the author does not have enough postgresql experience to compare it to mysql.
MysSQL has a much larger user base than PostgreSQL, therefore the code is more tested and has historically been more stable than PostgreSQL and more used in production environments.
"Claiming that your RDBMS is the best in the world because more people use it is like saying McDonalds makes the best food in the world."
Sorry, just an old joke that deserved retreading... ;)
"I can be self-referential if I want to," said Tom, swiftly.
In Debian, they call this "stable". See - packages.debian.org/stable/misc/postgresql
oh, wait...nevermind.
I suspect you're thinking of relatively simple cases where you have a single application working against a database. Which of course is the standard MySQL scenario.
Where foreign keys and the other referential integrity features really shine is in true enterprise scenarios, when you may have hundreds or thousands of applications, written in multiple languages, working against the same shared database(s).
In that scenario, the only viable way to duplicate the functionality of foreign keys at the application level is to have a middle layer which all other applications are required to go through. Realistically, that middle layer has to be implemented as a server, serving requests for object/record creation, update and delete over the network. Implementing it as a library to be linked into applications doesn't work well, because there are multiple applications accessing the database, and integrity enforcement needs to be centrally coordinated.
Implementing a middleware data server for an application isn't all that difficult, but integrating it into applications can be. Most application development environments know how to talk to databases, but don't automatically know how to talk to your application-specific, language-independent, data server. So now you're writing a client library for each app dev platform used in the enterprise, and dealing with things like integrating your custom interface with data-bound controls in the user interface. BTW, this is where people start resorting to e.g. SOAP, and projects start going off the rails (no pun intended, Ruby fans).
Luckily, as it turns out, there are already standardized, widely-available, well-supported systems that implement a centralized data serving service which enforces referential integrity. They're called databases. And foreign keys are an essential part of the service they provide.
I have earned a good living writing fairly stupid Perl scripts to fix refential integrity in MySQL databases that foreign keys would have prevented easily. (Why is it always the SYSTEM ADMINISTRATOR who has to fix all that crap?) Please do not endanger my career!
Yeah any coder can work around this - and bats will fly out of my nose on Christmas Day!
Give a man a fish and you have fed him for today. Teach a man to fish, and he'll say "WHERE'S MY FISH, YOU IDIOT?"
This review seemed to overlook two important factors:
1) PostgreSQL has what at first appears to be a very cool "Oject Oriented" feature where one table can inherit from another. Once you spend some time investigate this feature, you find out that referential integrity and derived tables are mutually exclusive. (i.e. if you have a Produce table with a foreign key referencing the Fruit table, but Fruit has two children (Apples and Oranges), the foreign key constraint will prevent you from ever inserting anything into Produce that references a row in Apples or Oranges). This really pisses me off because save that SNAFU, OO would be a really useful feature in Postgre.
2) PostgreSQL support OS account integration. I don't have to have a completely separate set of user account for my database. Even though MySQL gives me fine-grained security, to use it I have to implement and maintain a whole new set of user acconts, which makes it easier to just have the anonymous "ABCApp" account that my app uses to accese the database. I know this is how 99% of database driven apps out there work, but it doesn't change the fact that it's just plain wrong.
In the end, I still use MySQL because I just find that it has better documentation and community support.
I use mysql with billion row tables , all indexed just fine, instant return on select queries.. Tired of these noobs not knowing what they are doing..
Any senior application developer, architect, or DBA knows the importance of having the database provide as much data protection as possible. That's why thousands of engineers were involved in the creation of the ANSI92 specs.
Which implies that the results likely DO NOT include all the work sponsored by an overseas company (NEC?)
I do not fail; I succeed at finding out what does not work.
Those people would probably tell you it is a mute point :P
... insert into mydate values('99/99/9999') fails with an error stating it's invalid. at the moment, it allows that shit as a valid date. mysql is NOT a good db.
If you mod me down, I will become more powerful than you can imagine....
I've sent the email below to the address mentioned in the trailer of the page:
a tures.html shows the
Hi!
Some minor points:
Large objects:
your page suggests that PostgreSQL does not support large object the
way mysql does. In reality it has been supporting large rows for years
now. It has the TEXT datatype and the BYTEA datatypes to store texts
and binary columns without limits. (Well, both mysql and postgresql do
have huge limits on rowsize)
SQL conformance:
http://www.postgresql.org/docs/8.0/interactive/fe
details of the SQL conformance for PostgreSQL 8.0, and is (c) 2005,
guess this was available when you researched your comparision.
It especially does not do a subset of SQL 92/99, it's rather compliant
to SQL 2003. Certainly more so than say mysql, which has been slowly
adding SQL support, as you say yourself; notice that Mysql AB in their
sales documentation don't claim any SQL conformance,
PostgreSQL does allow selecting data over different databases via
dblink, but it's a kludge. OTOH, mysql optimization papers still claim
denormalisation as a solution to the fact that MySQL5 only has Nested
Loop as an executation strategy for joins. Furthermore, subselects are
always materialized.
Speed:
I question your blanket statement that MySQL is very fast on complex
queries. As noted above, it's very sensitive to the way a query is
formulated, and has basically only the most primitive execution
strategies for joins and subselects. Complex queries DO involve
usually both of these constructs.
You also mention the problem of forking backends for startup speed
problems. I'd like to point out that the classical solution to that is
to use a connection pool either in your app (as e.g. PHP provides), or
use pgpool.
Stability:
Anecdotal evidence. Fact is that mysql crashed data this month in the
office, and I've had deployed Postgres95 about a decade ago, and never
lost data. Fact is, that MySQL is offering many options where the
application can decide to have an unstable/unsafe DB setup (by
choosing e.g. MyISAM storage), while the same "performance
optimizations" for PostgreSQL are only available via the server
config. OTOH, PostgreSQL has only just now become stable enough on
64bit platforms to consider productive usage.
Special Serverside features:
You seem to miss the wealth of features that PostgreSQL provides. E.g.
it is one of the most flexible DBs to support updateable/insertable
views. Addtionally, it supports vertical table partitioning, etc.
National Language support:
PG can set the language per database and cluster. Actually, it can
only set the encoding while creating the database:
createdb -E UTF8 testdb
createdb -E SQL_ASCII testdb
Hopefully you can update your comparision, don't hesitate to ask if
you have any questions.
yacc
Or did you mean a moot one? :)
_
\\/ are accustomed' - First Lensman
The person who WROTE this article obviously doesn't know the meaning behind the jargon he uses.
Not to mention, he didnt know the meaning like. Over 2 years ago.
-- I'm the root of all that's evil, but you can call me cookie..
1. "MySQL runs as a native Windows application (a service on NT/Win2000/WinXP), while PostgreSQL is run under the cygwin emulation."
Get your facts. If this review ist really 15 months old, the 8.x series was available more than 6 months, and it's running native on Windows.
2. under section "SQL standard COMPLIANCE": MySQL uses SQL92 as its foundation. Runs on countless platforms.
Wow. It's completly new to me that the number of platforms is related to SQL standard compliance. Beside this, standard conformance is far better in postgresql, there are numerous comparision tables available.
3. "STABILITY": mentioning 6.x releases clearly states how clueless the authors of the review are. Last update for 6.5 was in early 1999.
4. "LARGE OBJECTS": "In Postgres, Large Objects are very special beasties.". Historically seen - right. But why not use the bytea datatype as available in Postgresql for several years now?
5. "ALTER TABLE": 15 month ago postgresql of course had full support for all those functions.
Biased, clueless and just stupid review.