tag:blogger.com,1999:blog-11683713.post116499365615355500..comments2024-01-12T21:16:50.520-08:00Comments on Spyced: Benchmark: PostgreSQL beats the stuffing out of MySQLJonathan Ellishttp://www.blogger.com/profile/11003648392946638242noreply@blogger.comBlogger30125tag:blogger.com,1999:blog-11683713.post-64966531453662565832010-08-08T10:12:54.494-07:002010-08-08T10:12:54.494-07:00I realized the power of PostgreSQL a little late. ...I realized the power of PostgreSQL a little late. I am not an usual blogger but to show this difference, i wrote a post here.http://tmsajin.blogspot.com/2010/08/performance-comparison-test-between.htmlSajin tmhttps://www.blogger.com/profile/10386840875702509942noreply@blogger.comtag:blogger.com,1999:blog-11683713.post-79501396199065701172009-04-11T20:46:00.000-07:002009-04-11T20:46:00.000-07:00FartFartAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-91539920689818581702008-05-09T07:30:00.000-07:002008-05-09T07:30:00.000-07:00Postgres is good, MySql is good, Oracle is good. M...Postgres is good, MySql is good, Oracle is good. Mostly the quality of the code you produce is dependent on you knowing the db you're coding against. I like Postgres & Oracle, because I have experience with them. both do a fine job of storing data.<BR/><BR/>Arguments pro/con about postgres work better if they are rational, factual and emotionless. I think your opinion here is valid, but the presentation is not flattering to you. Don't worry be happy. :-)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-46626814237463316282008-03-12T12:10:00.000-07:002008-03-12T12:10:00.000-07:00Joe,Anyone who says "Postgres has always been late...Joe,<BR/><BR/>Anyone who says "Postgres has always been late to the party" got to the party pretty damned late themselves.<BR/><BR/>I remember when MySQL had no support for relational integrity, no support for views, no support for transactions... and while PostgreSQL had all those things, the MySQL team was promoting the idea that all those features were useless performance-impacting cruft that nobody needed unless they were running a bank.Unknownhttps://www.blogger.com/profile/13256643807812018434noreply@blogger.comtag:blogger.com,1999:blog-11683713.post-83739316113483876292008-02-27T12:58:00.000-08:002008-02-27T12:58:00.000-08:00It seems people have overlooked one issue...Genera...It seems people have overlooked one issue...<BR/><BR/>Generally speaking, speed and quality (aka data integrity) are inversely related in databases. That's why traditionally Oracle was the slowest and MySQL was the fastest. This is why your database license often forbids you from publishing benchmarks, because fast speed makes people think it makes for a better database.<BR/><BR/>But as time has progressed and each DB has matured, after they've achieved quality, they've been optimizing things to improve speed without losing features or data integrity.<BR/><BR/>I've been biased towards msSQL because it offers great features (was especially important years back, but now everybody has Stored Procs and transactions) and amazing speed. But in today's world, and licensing, I could see myself preferring PostgreSQL and MySQL (if I really had to) as they have all the essential features and started to go beyond needing key features and are entering the state of maturing those features.TravisOhttps://www.blogger.com/profile/10580035916326604142noreply@blogger.comtag:blogger.com,1999:blog-11683713.post-11098722779855730042007-12-02T04:22:00.000-08:002007-12-02T04:22:00.000-08:00Humm.. So we really can state this:Performance dep...Humm.. So we really can state this:<BR/><BR/>Performance depends on your benchmark ;-)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-13447535384467251162007-12-02T04:19:00.000-08:002007-12-02T04:19:00.000-08:00I am currently comparing a mySQL5 install with a P...I am currently comparing a mySQL5 install with a PostgreSQL 8.2 install on the same machine. The app I'm planning has to take huge insert loads. And guess waht? mySQL performs MUCH faster (3 to 4 times) when inserting BIG bunchs of data. And no. I am not using delayed inserts.<BR/><BR/>What a pity. Postgresql looks so much more mature to me.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-49927600289786865072007-04-12T02:18:00.000-07:002007-04-12T02:18:00.000-07:00ScimoreDB does scale-out. However, they are missin...<A HREF="www.scimore.com/technology/tpc.aspx" REL="nofollow">ScimoreDB</A> does scale-out. However, they are missing features: no views, not real procedures, no replication...<BR/>For distributed query processing, they use functional shippment rather than data, that benefits performance a lot to compare with MySQL cluster.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165918686907081192006-12-12T02:18:00.000-08:002006-12-12T02:18:00.000-08:00I found the tweekers benchmark very useful, and it...I found the tweekers benchmark very useful, and it is reasonably neutral since they are a mysql site and seems slightly shocked at how fast postgres was after all the historic press about mysql being faster.<BR/><BR/><B>Internal Benchmarks</B><BR/>We wrote some internal benchmark software in dotNet, and found postgres 8.0 about 50% faster than mysql (InnoDB)both running on windows with a dotNet client. The test was a stored proceedure that similated creating invoices for multiple companies. There was a table with each companies current invoice no which was incremented as new invoices were inserted into the general invoice table. We then ran X companies with y threads per company.<BR/><BR/>SQL server screamed at around 1,500 transactions per second, Postgres peeked at around 300, and my sql at 180. The biggest problem with Postgres under windows was that windows allocated too much memory to each postmaster process. It is much much more efficent with a unix platform.<BR/><BR/>The main difference betwen Postgres and both mysql and sql server is that it does not colapse under load. When we really stressed things mysql just gave up, and we have crashed the server. SQL server performance dropped from 5 times faster to around 20% faster.<BR/><BR/>I recently build a collection of virtual machines Open BSD, Free BSD, Net BSD, Ubuntu, deb etch, gentoo and have been meaning to try postgres under these.<BR/><BR/>Postgres was around 70 transactions per second on open bsd, using 100% cpu on the virtual machine (50% cpu of the actual machine)<BR/><BR/><B>MVCC works</B><BR/>It is really noticable that postgres keeps going under heavy load. Where as the row level locking databases slow down a lot from their peaks.<BR/><BR/>I have not done a bench mark yet with postgres on a unix box vs sql server with different clients, but it is noticable that a postgres system on unix only uses about 60 meg for around 100 connections, which is reasonable vs the gig on windows.<BR/><BR/><B>My SQL Cluster</B><BR/>We had intended to go with MySQL Cluster since it is by far the best cluster architecture and the backend is rock solid and incredibly efficent.<BR/><BR/>Unfortunately the front end servers let it down. We tuned it up from around 5 transactions per second (10meg interconnects)to 180 per second (100 meg switched) on our internal benchmark. <BR/><BR/>We did manage to get about 2,000 inserts per second into the cluster using 3 front end machines, and the backend was still under minimal load.<BR/><BR/>There have been a lot of features added in mysql 5 and it is maturing very quickly.<BR/><BR/>Our current strategy is to stay with SQL server, try and move to postgres and keep watching the mysql clusters.<BR/><BR/><BR/><B>Case insensitive collations</B><BR/>Comming from SQL server case sensitive collations are a real pain. However we have written our own search engine which converts everything to lower case, which means for that part it will be fine, and our primary keys are all int so again no issue. <BR/><BR/>The bits that bug me are that unless you use lower case in all your table/column names you have to quote them. I prefer WordWord to word_word names. The crazy thing is that the engine converts WordWord to wordword unless it is quoted.<BR/><BR/><B>utf8 support</B><BR/>The biggest advantage for us in moving is the utf8 support in both mysql and postgres.<BR/><BR/>Would prefer case insensitive indexed where clauses, but it will be a very big job porting, and we can probably live with it, since we are looking to translate our table generation, and stored proceedures into the new database, and use one set of code for both databases.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165511633393666212006-12-07T09:13:00.000-08:002006-12-07T09:13:00.000-08:00Would be nice to compare apples to apples. The tw...Would be nice to compare apples to apples. The tweakers article, while thorough, compares the most current PostgreSQL *development* version to the >3 year old MySQL 4.1 series and the >1 year old 5.0 series.<BR/><BR/>Would be nice to see the 2 dev versions against each other...<BR/><BR/>As a MySQL employee, I think it's fair to say that PostgreSQL has done a fantastic job in focusing on performance-tuning for the 8.2 release, and kudos to Josh and the team for their efforts!<BR/><BR/>Both RDBMS systems have something to offer for various crowds in need of dissimilar features, add-ons, ease of use, etc. No one at MySQL knocks PostgreSQL. We thrive on the healthy competition that comes out of the open source community.<BR/><BR/>Anyway, on a general note regarding benchmarks, it is almost always possible to create benchmark results that prove a specific point in favor of one side of an argument. But, in the case of the tweakers benchmarks, I think that the results indeed show a performance degradation for multiple cores/processors that MySQL should look at closely, and I'm sure our engineers will do so.<BR/><BR/>On a related note, I should note that the MySQL 5.0.30 release included a patch for InnoDB performance which showed a substantial increase in performance on multi-core/processor machines (>20% AFAIK).<BR/><BR/>Anyway, cheers,<BR/><BR/>Jay Pipes<BR/>Community Relations Manager, North America, MySQL, Inc.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165322230431190022006-12-05T04:37:00.000-08:002006-12-05T04:37:00.000-08:00Im not here to pick sides, but reading about the H...Im not here to pick sides, but reading about the HOW the benchmark was done leaves many questions.<BR/><BR/><B>Read/write</B><BR/>As far as i can tell, its mostly simple select statements? So how is the write operations in comparison?<BR/><BR/><B>Bechmarking sql? or php?</B><BR/>Also, it seems the benchmark was made by requesting a php4.4 page, through apache 2.2, using "apache-bencmark", which begs the question: Are the SQL client implementations in PHP equally good?<BR/><BR/><B>The statements</B><BR/>And where are the actual SQL statements? It is importent to see these to understand the benchmark.<BR/>Eg. Did the test contain LIKE statements? And did the test use ILIKE on postgres, so the actual search was the same?<BR/>Ie. were the sql-statements "designed" for postgres?<BR/><BR/><B>Conclusions</B><BR/>There are so many extra- and unkown factors in this benchmark that one cant conclude anything from it.<BR/><BR/>Like <I>Jonathan Ellis</I> stated in the original text. MySQL benchmarks tend to favor their own product. So does mssql, oracle and so forth.<BR/>Id love to see and absolutely independed benchmark of all these. Also of postgres, so youre sure that the guys benchmarking are out to prove postgres faster, instead of an unbiased bench.<BR/><BR/>Ppl tend to get very, ehrrm... Religious about their favorite product. If the benchmarker is just half as biased as this original blog-post, the entire test-result is useless.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165320487596035442006-12-05T04:08:00.000-08:002006-12-05T04:08:00.000-08:00Apparently there's always MySQL Cluster if you wan...<I>Apparently there's always MySQL Cluster if you want to use lots of hardware</I><BR/><BR/>Hehe, check this post: http://forums.mysql.com/read.php?25,93181,93181Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165281423240961052006-12-04T17:17:00.000-08:002006-12-04T17:17:00.000-08:00I noticed the description of the benchmark mention...I noticed the description of the benchmark mentioned this:<BR/><BR/>"[PostgreSQL] has had a couple of its indexes replaced to allow better performance. Additionally, a few data structures were altered."<BR/><BR/>Based on this vague statement and the overall text it seems to me that this benchmark was meant to compare processors, not databases. The point is to find out which processor is fastest for each database, not which database is fastest. The results may still be relevant, but this interpretation sounds like an over-generalization at this point.<BR/><BR/>Also it's worth noting that the benchmark looks mainly at read speed when all data is in the buffer cache. For many applications this is far from the only interesting benchmark for comparing databases. However, it's a good benchmark for comparing processors to each other.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165272349055483252006-12-04T14:45:00.000-08:002006-12-04T14:45:00.000-08:00I find it remarkable that people here have defende...I find it remarkable that people here have defended the lack or a case insensitive collation feature here. It's a feature that every other database has open source or otherwise. It's a feature that has been asked for for years by people who want to use postgres. It's a feature that's easy to add. Despite all that it does not exist in postgres.<BR/><BR/>Instead we get semi insulting suggestions at workarounds like use *~ or ILIKE neither of which are an SQL standard or use the full text searching.<BR/><BR/>Here is another suggestion for people who want case insensitive where clauses. Use mysql, mssql, oracle, firebird, db/2, openbase, frontbase, or any one hundreds of databases that have that feature.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165256984648356002006-12-04T10:29:00.000-08:002006-12-04T10:29:00.000-08:00Working in oracle most of the time, the practice I...Working in oracle most of the time, the practice I'm most used to is using upper() and lower() statements. <BR/><BR/>These have the advantage of being nearly universal.geoavehttps://www.blogger.com/profile/05067198961206614791noreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165256528199265802006-12-04T10:22:00.000-08:002006-12-04T10:22:00.000-08:00Joe: "Make a case insensitive collation for postgr...Joe: "Make a case insensitive collation for postgres. Failing that make a case insensitive text type (somebody has already done it!!!) and include it in the default distribution."<BR/><BR/>PostgreSQL is extensible and using some of the rich set of extensions available is expected. Try telling PERL that a capability isn't good enough because it's in CPAN rather than "the default distribution".<BR/><BR/>Download and install the extension that does what you need, and install. This has all kinds of benefits over the MySQL "everything goes in core" mentality. For one, you can get an updated module without having to wait for the next release of PostgreSQL. Slony-I is a great example of an add-on. If it had to wait each time for a full PostgreSQL release, the project would not be where it is today.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165253273058872772006-12-04T09:27:00.000-08:002006-12-04T09:27:00.000-08:00Joe: Hmm really weird that you can't handle search...Joe: Hmm really weird that you can't handle searching in your rails app. I have just built an file indexing/ searching/version control system with rails and postgres... Works great! (Even though tsearch2 have some issues with partial word matching...)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165229371573893612006-12-04T02:49:00.000-08:002006-12-04T02:49:00.000-08:00JOE: "This is a simple collation problem and peopl...JOE: "This is a simple collation problem and people have been asking for it at least five or six years (just query the mailing list) and the postgres team refuses to come up with a case insensitive collation or to include any of the case insensitive data types people have developed."<BR/><BR/>I'm not surprised, but then that's actually the right thing to do. I was fairly surprised to see that MySQL had a case insensitive collation enabled by default, causing a slight inflation of results for my application, and I imagine that for many applications it's totally inappropriate.<BR/><BR/>JOE: "The only excuse they have is that it's not "standard" as if ILIKE or *~ are standards."<BR/><BR/>Sounds like a good excuse to me.<BR/><BR/>And on the subject of full-text searching, I read in various places (including the MySQL manual's comments) that MySQL is relatively hopeless for any real full-text search solution. If ticking boxes on the feature sheet is important then I guess MySQL is just fine; otherwise, I suppose people may find the various extensions to PostgreSQL convenient enough to compile.<BR/><BR/>JOE: "Just last week I abandoned my attempt to trying it one more time (with rails) because I can't demand that my users remember the precise capitalization of every piece of text and I don't want to rewrite activerecord."<BR/><BR/>This sounds like a combination of user interface shortcomings and inadequate tools to me.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165218888425493952006-12-03T23:54:00.000-08:002006-12-03T23:54:00.000-08:00This is bug http://bugs.mysql.com/bug.php?id=15815...This is bug http://bugs.mysql.com/bug.php?id=15815, fixed in 5.0.30.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165205344107279452006-12-03T20:09:00.000-08:002006-12-03T20:09:00.000-08:00For data replication/failover/etc for Postgresql, ...For data replication/failover/etc for Postgresql, check out pgpool. I've been using it for awhile, and works really well!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165199535361669852006-12-03T18:32:00.000-08:002006-12-03T18:32:00.000-08:00"Perhaps you need to find some better ORMs. The on..."Perhaps you need to find some better ORMs. The one I work with (built in to Django) supports your choice of "contains" (which translates to LIKE in Postgres) or "icontains" (which translates to ILIKE) in its querying syntax."<BR/><BR/>That's wonderful but what if you are not using django? I am sure django is wonderful and all but some people may prefer ruby, or php, or java, or .net or something.<BR/><BR/>Also what does using ILIKE do to your speed? Does it use indexes? Would an application where every instance of X='abc' is run as x ILIKE 'abc' run at acceptable speeds?<BR/><BR/>Anyway you missed my point. The point is that for at least the last five years this topic has come up again and again on the postgres mailing lists. People wanting to migrate from mysql, ms-sql, sybase, informix etc have asked for it. The solution is simple. Make a case insensitive collation for postgres. Failing that make a case insensitive text type (somebody has already done it!!!) and include it in the default distribution.<BR/><BR/>Why is the postgresql team so obstinate about this much requested feature? Does anybody buy the "it's not a standard" line especially when the next paragraph says "use ILIKE"?<BR/><BR/>I know I am ranting a bit but it's only because I WANT to use postgres but am unable to do so because it's lacking a feature I really need. Every time I try to use it I run into some limitation or another. I remember in the days of yore waiting for outer joins and then giving up when I deadlines caused me to use another database instead.Tim Uckunhttps://www.blogger.com/profile/14789654807433748534noreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165196856343128192006-12-03T17:47:00.000-08:002006-12-03T17:47:00.000-08:00Joe said:"That's fine but it means I can't use any...Joe said:<BR/><BR/>"That's fine but it means I can't use any of the ORM layers written in any language. It means I have to litter my code with SQL statements that are postgres specific (ILIKE or *~). "<BR/><BR/>Perhaps you need to find some better ORMs. The one I work with (built in to Django) supports your choice of "contains" (which translates to LIKE in Postgres) or "icontains" (which translates to ILIKE) in its querying syntax.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165191203630698932006-12-03T16:13:00.000-08:002006-12-03T16:13:00.000-08:00"Use "ILIKE" instead of "LIKE" (although, indexing..."Use "ILIKE" instead of "LIKE" (although, indexing lower(column) and comparing against lower('where_clause') can use an index, whereas ILIKE can not."<BR/><BR/>That's fine but it means I can't use any of the ORM layers written in any language. It means I have to litter my code with SQL statements that are postgres specific (ILIKE or *~). <BR/><BR/>This is a simple collation problem and people have been asking for it at least five or six years (just query the mailing list) and the postgres team refuses to come up with a case insensitive collation or to include any of the case insensitive data types people have developed. The only excuse they have is that it's not "standard" as if ILIKE or *~ are standards.<BR/><BR/>Anyway postgres has always been late to the party. Late on replication, late on clustering, late on full text searching, late on a windows port, late on ODBC drivers, late on ADO drivers, and still no case insensitive collations or data types.<BR/><BR/>This is why people use mysql. They deliver what people want. Yes you can argue that MYSQL implementations of some that stuff is crap, yes you can argue that postgres has other better features but you can't deny that mysql delivers what most people want before postgres does. <BR/><BR/>If you are wondering why people use mysql that's the reason. For the last decade I have tried many times to use postgres in one my projects and every time I run into one obstacle or another. Just last week I abandoned my attempt to trying it one more time (with rails) because I can't demand that my users remember the precise capitalization of every piece of text and I don't want to rewrite activerecord.Tim Uckunhttps://www.blogger.com/profile/14789654807433748534noreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165185540154332572006-12-03T14:39:00.000-08:002006-12-03T14:39:00.000-08:00PostgreSQL has a mechanism called MVCC (MultiVersi...<I><BR/>PostgreSQL has a mechanism called MVCC (MultiVersion Concurrency Control), comparable or superior to best commercial databases. It can do row-level locking, can lock rows for writing in one session but give these rows unaffected in another session. </I><BR/>This has an disadvantage also, it leads to defragmented data because an update to a row is actually done on a copy elsevere in the file/filesystem. This leads again to slower sequential reads of tables due to the architecture of an harddrive.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11683713.post-1165182812660587312006-12-03T13:53:00.000-08:002006-12-03T13:53:00.000-08:00I was using mysql.. then switched recently to post...I was using mysql.. then switched recently to postgresql...<BR/>The MySQL databased folder was 8times the size of postgresql folder..<BR/><BR/>The site is perceptibly faster. Love MVCC, pg_autovacuum, no locking required... <BR/><BR/>http://www.teenwag.com<BR/><BR/><A HREF="http://www.teenwag.com" REL="nofollow">Teenwag</A><BR/><BR/>thanks for an awesome decisive post...Anonymousnoreply@blogger.com