tag:blogger.com,1999:blog-3185405121943567697.post814991206596823114..comments2008-10-30T03:49:34.654-07:00Comments on Page2RSS: PostgreSQL vs. MySQL Performancepasterhttp://www.blogger.com/profile/10152375450834253913noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-3185405121943567697.post-74706767118675169242008-10-30T03:49:00.000-07:002008-10-30T03:49:00.000-07:002008-10-30T03:49:00.000-07:00Using InnoDB tables is not just for transactions. ...Using InnoDB tables is not just for transactions. You can never use transactions and still benefit from the fact that InnoDB can quickly recover from a crach. While MyISAM will need a time consuming table check!<BR/><BR/>In general I would love to see PosgreSQL taking over the market share from MySQL.. because that is the only thing PosgreSQL is missing. The huge user base.<BR/><BR/>And at the end of the day, I think the world would be a better place with PostgreSQL in the place of MySQL! :DHarryhttp://www.blogger.com/profile/14101871353282861009noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-69193608560351368452008-10-08T12:44:00.000-07:002008-10-08T12:44:00.000-07:002008-10-08T12:44:00.000-07:00Finally. A real world scenario that proves what I'...Finally. A real world scenario that proves what I've known all along. PostgreSQL is better.<BR/><BR/>Also, even if the MySQL guys want to argue with me about performance, I want to ask them why any serious database design on their platform requires that I have InnoDB tables and MyISAM tables, mixed together, only to get cornered into gotchas later on with advantages and disadvantages to each. That's just plain crazy.<BR/><BR/>The only reason the pendulum has swung towards MySQL is because they had a huge marketing arm behind it. And as we can see from marketing at Microsoft Corp, for instance, we're not always given the best facts.Mr. Greyhttp://www.blogger.com/profile/11508378294115354623noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-54526975417138321382008-07-18T15:53:00.000-07:002008-07-18T15:53:00.000-07:002008-07-18T15:53:00.000-07:00I guess you haven't optimized your SQL. Innodb nee...I guess you haven't optimized your SQL. Innodb needs some tweaking to get ok performance. count(*) is a killer, etc. Give myisam a try too.Henrikhttp://www.blogger.com/profile/12554441328353976215noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-3580927953959742102008-07-09T01:59:00.000-07:002008-07-09T01:59:00.000-07:002008-07-09T01:59:00.000-07:00I have linux VPS machines with 256 and 512 ram. i ...I have linux VPS machines with 256 and 512 ram. i configure mysql use less than 8 or 16 Mb of ram and it is really fast... even on large datasets (200-500mb db). <BR/><BR/>using myisam is a good solution.fredhttp://www.blogger.com/profile/03520242998212617599noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-40269164526793796982008-07-09T01:57:00.000-07:002008-07-09T01:57:00.000-07:002008-07-09T01:57:00.000-07:00if you know how to configure mysql properly you wi...if you know how to configure mysql properly you will be surprised how good it performs... <BR/>Most people who use mysql and complain its performance doesn't even know what is the my.cnf file.<BR/><BR/>read, research, experiment before u make conclusions.fredhttp://www.blogger.com/profile/03520242998212617599noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-38086104553804749182008-05-12T06:21:00.000-07:002008-05-12T06:21:00.000-07:002008-05-12T06:21:00.000-07:00@TeddySo Google and NASA are using "gay" software?...@Teddy<BR/><BR/>So Google and NASA are using "gay" software? So much for your vast experience. I'll go with what's good for the rich developers with proven solutions./marcusiddybiddydicushttp://www.blogger.com/profile/09208957201664492459noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-50459346229957759312008-02-14T14:18:00.000-08:002008-02-14T14:18:00.000-08:002008-02-14T14:18:00.000-08:00MySQL IS SO GAY!!!!!!And anyone with real developm...MySQL IS SO GAY!!!!!!<BR/><BR/>And anyone with real development or dba experience (not just a script kiddie) knows whyTeddyhttp://www.blogger.com/profile/16289596916330815566noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-6089857640004758232007-09-12T10:13:00.000-07:002007-09-12T10:13:00.000-07:002007-09-12T10:13:00.000-07:00Thanks for the nice post!Free PS3Thanks for the nice post!<BR/><BR/><A HREF="http://free-ps3-for-me.blogspot.com/" REL="nofollow">Free PS3</A>butlimoushttp://www.blogger.com/profile/02018306067715934926noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-83063506717378068472007-02-26T09:42:00.000-08:002007-02-26T09:42:00.000-08:002007-02-26T09:42:00.000-08:00How did you collect your data for "Google's Time s...How did you collect your data for "Google's Time spent downloading a page"?markstoshttp://www.blogger.com/profile/06166735698055438666noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-19631967765886540252007-01-19T17:08:00.000-08:002007-01-19T17:08:00.000-08:002007-01-19T17:08:00.000-08:00By default, InnoDB uses a more severe isolation le...By default, InnoDB uses a more severe isolation level for transactions than PostgreSQL does. To make it equivalent, you would set MySQL's isolation level to READ-COMMITTED. Otherwise, it uses SERIALIZABLE, which is overkill for more most web apps.perrinhttp://www.blogger.com/profile/17800887826023846457noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-79338345630245860722007-01-19T10:03:00.000-08:002007-01-19T10:03:00.000-08:002007-01-19T10:03:00.000-08:00@Russ, Although MySQL doesn't have row level locki...@Russ, Although MySQL doesn't have row level locking, if you don't delete rows, mysql can concurrently select and insert. This is critical for concurrency performance.Matthttp://www.blogger.com/profile/02821077220296720642noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-84366240009869139642007-01-19T09:26:00.000-08:002007-01-19T09:26:00.000-08:002007-01-19T09:26:00.000-08:00What graphing software are you using? It's pretty...What graphing software are you using? It's pretty.Post Paint Boyhttp://www.blogger.com/profile/07884019458070767607noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-53918530879686364932007-01-19T08:27:00.000-08:002007-01-19T08:27:00.000-08:002007-01-19T08:27:00.000-08:00Depending on your usage pattern, MyISAM can be vas...Depending on your usage pattern, MyISAM can be <b>vastly</b> slower than InnoDB due to its table-level locking.<br /><br />If you have a lot of concurrent read/write threads, MyISAM effectively serialises your queries against often-hit tables. Not good for concurrent performance...Russhttp://www.blogger.com/profile/16316421877878482537noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-49013322031538450792007-01-19T08:10:00.000-08:002007-01-19T08:10:00.000-08:002007-01-19T08:10:00.000-08:00At Feed Digest we use MySQL. Approximately 10 giga...At Feed Digest we use MySQL. Approximately 10 gigabytes of data (anything over a month old is erased on the fly) over 10 tables, 50~150 requests per second (half INSERTs, half SELECTs, no UPDATEs, some DELETEs) and MySQL doesn't even break a sweat.<br /><br />I have been considering Postgres, but I always find MySQL performance problems are due to using MySQL poorly. One thing MySQL can suck on is doing ordered joins on large tables, since it tries to build a temporary table for the ORDER BY each time.. the solution? A meta-data table and some denormalization.<br /><br />Performance used to be poor at one tenth the database load before I undertook a significant amount of research and reading into MySQL's operation and came up with solutions to use it properly.<br /><br />Now, the MySQL performance using the new techniques beats Postgres performance using the old techniques. I'm certainly a big believer that improving overall technique will /usually/ (but not always!) yield better results than throwing more power or different software at a problem.<br /><br />I'm intrigued where your variable length text field of up to 32KB is coming from.. you're hashing rather than storing page content, right? :)<br /><br />Anyway, thanks for the results, it's always useful to see people testing these things even if the advice does not apply for every situation.coophttp://www.blogger.com/profile/15128608987278611416noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-78167895498576810862007-01-19T07:57:00.000-08:002007-01-19T07:57:00.000-08:002007-01-19T07:57:00.000-08:00Depending on the number of queries both databases ...Depending on the number of queries both databases use different methods to update rows. Postgres will delete and insert a new one without worrying about removing the deleted row from the table (the information isn't used, but the space is still allocated). This is why VACCUM needs to be run frequently. Depending on the queries the locking could be different between databases as well. I know MySQL used to only lock the tables and postgres would lock on the row level. This allows multiple updates/insert/deletes to occur at the same time.dbloodhttp://www.blogger.com/profile/05236139392248604728noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-16190284870832154272007-01-19T07:16:00.000-08:002007-01-19T07:16:00.000-08:002007-01-19T07:16:00.000-08:00I'm not for one database or another, but I'm willi...I'm not for one database or another, but I'm willing to bet the database structure for MySQL is not normalized properly, and with that, indexing is probably garbage too. It's interesting to see that you are using InnoDB and no transactions. As peternewman pointed out, InnoDB is generally used for transaction support, and also for extremely large amounts of data. I work with an 80gb database spread across just two MySQL servers, InnoDB, about 50 tables (most are referential) and MySQL actually smoked PostgreSQL across the board.mhttp://www.blogger.com/profile/03000270530175357346noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-75477034767488936312007-01-19T06:51:00.000-08:002007-01-19T06:51:00.000-08:002007-01-19T06:51:00.000-08:00Any particular reason for using the innodb on the ...Any particular reason for using the innodb on the MySQL installation?<br />Unless you're using the transaction functionality, it's a real performance killer. (Compare making 53,000 inserts on a 8 coloumn table in around 5 minutes with innodb, ~5 seconds with myisam).<br /><br />Regardspeternewmanhttp://www.blogger.com/profile/11609366996920704987noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-31407586492761627622007-01-19T04:42:00.000-08:002007-01-19T04:42:00.000-08:002007-01-19T04:42:00.000-08:00jaba: even if he did not properly index the MySQL ...jaba: even if he did not properly index the MySQL tables you can assume they ALSO did not properly index the PostgreSQL tables making this still an interesting apples-to-apples comparision. <br /><br />Wish I knew why PostgreSQL performs better in this case. I agree that the MySQL performance is a surprise. After all Google uses it and they are unlikely to make silly mistakes.Richard Freytaghttp://www.blogger.com/profile/07659102162953429642noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-74691719926499163942007-01-19T00:55:00.000-08:002007-01-19T00:55:00.000-08:002007-01-19T00:55:00.000-08:00Are you sure you had properly indexed your MySQL d...Are you sure you had properly indexed your MySQL databases? With a 2 GB database and such a low level of traffic MySQL shouldn't even sweat.jabahttp://www.blogger.com/profile/03125349757221142581noreply@blogger.comtag:blogger.com,1999:blog-3185405121943567697.post-7871342050785289912007-01-18T12:26:00.000-08:002007-01-18T12:26:00.000-08:002007-01-18T12:26:00.000-08:00Even if MySQL performance was two times better in ...Even if MySQL performance was two times better in my scenario you can see that PostgreSQL had no transaction timeout errors. It seems that MySQL has some trouble with concurrency in select/update/insert although it can't be beaten for select only requests.wskillshttp://www.blogger.com/profile/17156325531309299911noreply@blogger.com