Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

[ Create a new account ]

First "Real" Benchmark for PostgreSQL

Posted by ScuttleMonkey on Mon Jul 09, 2007 03:15 PM
from the waiting-for-the-opportune-moment dept.
anticlimate writes "A new benchmark published on SPEC shows PostgreSQL's performance approaching that of Oracle's and surpassing or on par with MySQL (however the test-hardwares of the other DB systems are somewhat different). The test was put together by PostgreSQL's core developers working at Sun. They certainly are not unbiased, but this is the first 'real' benchmark with PostgreSQL — according to Josh Berkus's blog. The main difference compared to earlier benchmarks (and anecdotes) seems to be the tuning of PostgreSQL."
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • however the test-hardwares of the other DB systems are somewhat different

    Which makes the results pretty much useless. But, being the intrepid slashdotter I am, I went ahead and R'ed the FA anyway, in case I could glean some useful information from it.

    Which revealed that the linked article doesn't actually contain any information whatsoever about Oracle* or MySQL, much less benchmarks on named hardware.

    So...what am I supposed to get out of this, again? Or is this just supposed to be some kind of PostgreSQL love-in, so I should take my wet blanket elsewhere?

    *Well, the second link contains someone claiming that Oracle is only 15% faster...but without providing any actual data.
    • Mod parent way up! by khasim (Score:3) Monday July 09, @03:23PM
      • Re:Mod parent way up! by Anonymous Coward (Score:2) Monday July 09, @03:40PM
        • Re:Mod parent way up! (Score:5, Interesting)

          Inserting 20 million rows, all simple inserts, only one primary key (int) with autoincrement for mysql and a sequence for postgres:
          Avg Mysql time per 1000 inserts: 3 seconds
          Avg Postgres time per 1000 inserts: 15 seconds (and gets worse over time)
          OK, now do a seven-table join, including a self-join with a correlated subquery (MySQL does those now, right?). I think everybody knows by now that MySQL is pretty much untouchable as long as all you're doing is simple single-table stuff. Kind of like comparing a pickup truck to a moving van: if all you're doing is moving a couple of boxes around, then the pickup kicks. But when you need to move serious loads, then it's the pickup that gets to sit by the curb...
          [ Parent ]
          • Re:Mod parent way up! (Score:4, Informative)

            by jedidiah (1196) on Monday July 09, @05:19PM (#19806683)
            (http://penguin.lvcm.com/)
            If you do that to even a "fast and robust" RDBMS server you are bound to be bludgeoned by the DBA.
            [ Parent ]
          • Re:Mod parent way up! by moderatorrater (Score:3) Monday July 09, @07:37PM
          • Re:Mod parent way up! (Score:5, Interesting)

            by arivanov (12034) on Tuesday July 10, @01:39AM (#19810195)
            (http://www.sigsegv.cx/)
            Who cares if MySQL does them or not. Show me the developers that can both develop applications and do SQL. That is a dieing breed. Most developers nowdays go for a really trivial schema and an abstraction layer. At that point the only thing that matters is row speed on simple table operations and there MySQL or in-memory OO database frameworks with a simple backing store wipe the floor. This is the reality of life. And it is not going to get better. If you look at the books on the market the only book that used to teach "proper" SQL (with joins and the lot) strictly from the context of application development was the old DB2 bible. It has not been reprinted since the late 90-es. All the rest that is out there is either heavily slanted toward the app side or towards the DB side (usually the latter). Add to that the fact that many universities try to teach "real life software engineering skills" instead of proper data structure and data manipulation classes and the picture is complete: http://www.joelonsoftware.com/articles/ThePerilsof JavaSchools.html [joelonsoftware.com]. Add to that the fact that DBDs when you actually corner them to ask something meaningfull answer with SQL technobabble like in your post. To the average developer it sounds like fortran. And if it looks like fortran, walks like fortran and talks like fortran it gotta be fortran. From the point of view of a average software engineer SQL and especially stored procedures look like a blast from the past. He expects to see objects, constructors, destructors, private and public structures. And what does he see? He sees something that looks like written by his grandparents. As a result he turns around and starts doing delete/insert/last_insert_id instead of replace and sequential deletions in software instead of foreign keys. I have tried in the past to work with developers who write commercial apps on top of SQL to optimise their code. And I have wanted to scream all along. In 95% of the cases you deal with either one of the following:
            • A nice schema designed once upon a time properly by a proper DBD that is vandalised in the application abstraction layer because the developers are are sorely pissed off by the endless wingeing of the SQL server and/or its abissmal performance. So they take the matters in their own hands and violate ACID by cashing and bypassing restrictions in the app. Sooner or later someone comes around and says - WTF, why don't we rewrite this all in software and sod off the expensive database. And surprise surprise it ends up being done in MySQL.
            • An abissmal schema or no schema at all where all restrictions are done in the app. That is MySQL country all the way.
            MySQL is a result of the way current software development is taught and done. Unless Jo the Average Developer starts understanding how to use SQL in his application (and he does not) and unless SQL data representation grows up to modern non-fortran-like OO semantics MySQL will proliferate. And if you think that MySQL is bad think twice. There are the object persistence frameworks and in-memory crap that follow in its wake.
            [ Parent ]
            • Re:Mod parent way up! by Hathor's Dad (Score:1) Tuesday July 10, @03:42AM
              • Re:Mod parent way up! (Score:5, Insightful)

                by arivanov (12034) on Tuesday July 10, @04:04AM (#19810769)
                (http://www.sigsegv.cx/)

                That is the problem - it does not in real life. Application works in developer hands, goes out in the field and breaks (seen that one time too many). Millions if not billions of dollars have been put to make sure that RDBMS transactions are atomic and preserve data integrity. No application level interface abstraction has ever afforded the expense and could ever afford the expense to do that. In every single instance I have looked at application developers replacing SQL ACID with "bake-their-own" system I have found cases of data integrity violations. In modern multithreaded (or web server based) apps the most common result from this is race conditions which are probably the hardest to debug problem in software.

                The other common problem in using application level abstractions is performance. Once again - works in developer hands, goes in the field, gets real data loaded in it and all hell breaks lose. Similar reasons to ACID as the next biggest investment after data integrity in a database is in its ability to fine-grain lock data objects. If a developer tries to replace RDBMS locking in the application layer, he usually ends up with higher granularity lock that is more contended. In addition to that to avoid race conditions, developers usually deliberately create a bottleneck by muxing all RDBMs access to a single thread and a single access point to simplify locking. In fact probably one of the most beneficial uses of MySQL is its ability to support server-based fine-grained locks that are not tied to a specific data object. You can use these in global semaphors and global locking even in cases where POSIX locks do not work (f.e. across clusters).

                Overall, yeah, MySQL and your app "already works". For Proof of Concept - maybe (in fact I use it myself). For real stuff - no, not really, unless you put a lot of work in the application layer. I have done that on quite a few occasions and the performance gains can be staggering compared to ACIDising your brain with a proper RDBMS, but the effort is hardly worth it in most real life scenarios. It also makes it considerably less maintainable.

                [ Parent ]
            • Mod parent(s) up, up, up by Anonymous Coward (Score:1) Tuesday July 10, @04:49AM
            • ORM / Denormalizing etc. by dusty123 (Score:1) Tuesday July 10, @06:37AM
            • Re:Mod parent way up! by rho (Score:2) Tuesday July 10, @09:38AM
            • Re:Mod parent way up! by kpharmer (Score:3) Tuesday July 10, @11:16AM
            • Re:Mod parent way up! by Doctor Memory (Score:3) Tuesday July 10, @01:00PM
          • Re:Mod parent way up! by ldholtsclaw (Score:1) Tuesday July 10, @11:20AM
          • Re:Mod parent way up! by blasiusmaximus (Score:1) Tuesday July 24, @05:51PM
          • Re:damn you must be a real shitty database admin by DuckDodgers (Score:2) Wednesday July 11, @09:38AM
          • 1 reply beneath your current threshold.
        • AC, sorry, but I have a postgres install working where I get 70k inserts/second or more with a single index on the table during the day. The first insert of course is faster as the index doesn't exist yet. I'm not sure what you're doing, but I can tell you that I have tuned postgres by increasing some simple parameters. If you're using some Linux package, you're likely not seeing the benefits that are possible by stuff like changing the block size parameter in the source. Yes, it's kinda lame you have to do this, but at the same time, it's not too unreasonable. I'd like it if I could set this larger.

          This is on 'decent' hardware running Solaris 10 (amd64). Obviously you need to tweak stuff like wal size, checkpoints, etc.. But getting this type of performance is not hard to do. I can scan an hours worth of data in a short amount of time. Each one of these 'hourly' tables contains roughly 30-32M rows. this is nothing to sneeze at from what I can tell. I haven't had a reason to re-evaluate mysql to see if there are enough tweaks to make it perform similarly, but if you're getting the crappy insert rate that you're talking about, you clearly need to change something as you're doing it wrong if you truly care about performance. E-Mail me if you're interested in my postgresql config files. I'm happy to share to minimize the FUD out there.

          [ Parent ]
        • Re:Mod parent way up! by jguthrie (Score:1) Monday July 09, @05:02PM
        • Re:Mod parent way up! (Score:5, Informative)

          by ctr2sprt (574731) on Monday July 09, @06:40PM (#19807435)

          You can do way better than that with PostgreSQL, at least, and I suspect with MySQL as well. I wrote a benchmark similar to yours, but a good bit more complex. I had two tables, one of which was seeded and another which was populated by the benchmark. The benchmark table had six columns (int, timestamp, 4x bigint), a primary key (int + timestamp), four check constraints (on the bigints), a foreign key constraint (int, to the seeded table), and two indexes (one int, one timestamp). I would do a commit every 75k rows, with 24 such commits per iteration and 30 passes per benchmark run, so 54 million rows total. I also used a thread pool, and there are two reasons for that. First, some amount of parallelism improves DB performance. Second, it more accurately simulated our predicted usage patterns of the database. We ran my benchmark against PSQL and IBM DB2.

          The results were interesting (at least, I thought they were). First, PSQL can only handle about 10 threads doing work at once. Past about 10 threads, the DB completely falls apart. DB2, however, could handle more busy threads than Linux could, with a very gradual (and linear) degradation in performance past about 25 threads. I stopped testing at 100 threads. Second, PSQL's inserts per second (IPS) rate cut in half by the end of the bechmark. DB2 followed a similar trend until about 5 million rows, at which point IPS went up to where it started and stayed there without moving. Third, DB2 was I/O-bound, whereas PSQL was CPU-bound. I suspect it's why DB2 was able to handle an order of magnitude greater concurrency: more threads just meant the CPUs had something to do while waiting on the disks. However, it does mean that PSQL might do better with faster CPUs, whereas DB2 would not (it'd just be able to handle more threads).

          And the numbers: DB2 averaged 1100 IPS, PSQL 600. Note that for the first million rows or so PSQL was faster: it just eventually dropped down to ~400 IPS after ten million rows or so, killing the average. Of course, since this table would never have fewer than 54M rows - actually, it would typically have 160M - the IPS I got at the end was the one that mattered. Also, this was on a pretty weak server, at least for this kind of workload. With more (and faster) cores, more memory, and more spindles, I'm pretty sure you could increase those numbers by 50% or more. With tuning, perhaps that much again.

          [ Parent ]
        • Re:Mod parent way up! by prog-guru (Score:2) Monday July 09, @08:57PM
        • Re:Mod parent way up! by bytesex (Score:2) Tuesday July 10, @04:09AM
      • Re:Mod parent way up! (Score:5, Insightful)

        by Vellmont (569020) on Monday July 09, @03:53PM (#19805679)

        You cannot compare benchmarks without SOMETHING standard between them.

        The thing that's standard is the benchmarking software.

        If I were to buy a database server, do I really care which component of the solution is providing me with the great performance, or do I just want the performance? At the end of the day the only thing that really matters is the performance that comes out of the box.

        It doesn't really matter if "Postgresql" is faster than "MySQL", because they always run on a certain physical computer. What matters is "I need to accomplish X,Y and Z. I have A dollars to spend. Which solutions accomplishes X, Y and Z the best within my budget? You can't separate the software from the hardware and get an answer that's very meaningful.

        This benchmark isn't the last word on anything. Even a benchmark run on the exact same hardware means very little if you have a 2 core machine instead of 8.
        [ Parent ]
      • Re:Mod parent way up! by Actually, I do RTFA (Score:2) Monday July 09, @04:33PM
      • Re:Mod parent way up! by timmarhy (Score:3) Monday July 09, @08:26PM
    • by Ngarrang (1023425) on Monday July 09, @03:26PM (#19805363)
      (Last Journal: Wednesday March 21 2007, @01:43PM)
      To paraphrase an old saying:

      There are lies, damned lies and benchmarks.
      [ Parent ]
    • by KillerCow (213458) on Monday July 09, @03:34PM (#19805467)
      I think that somebody sent the wrong link and (surprise!) the editors didn't even follow it to check.

      Here's a more useful one: All SPEC jAppServer2004 Results Published by SPEC [spec.org]

      The benchmarks aren't standardized enough for any useful comparison. The hardware and configurations vary in almost every one.
      [ Parent ]
    • however the test-hardwares of the other DB systems are somewhat different

      Which makes the results pretty much useless.


      Not necessarily.

      It's essentially useless for separating out how much of the performance difference is the result of the software's design, implementation, and tuning versus how much is due to the platform differences.

      But such tests CAN be used to examine the performance of competing ENTIRE SYSTEMS, to inform choices between them.

      They say: "Oracle on does THIS well, PostgreSQL on can be tuned so it does THAT well on the same benchmark."

      This lets administrators (presuming they have access to the hardware info) get a bang-for-the-buck comparison.

      For the rest of us, the interesting point is that PostgreSQL, running on its team's idea of realistic hardware, can produce performance in the same ballpark as Oracle running on Oracle's choice of hardware.

      (Whether the necessary remaining data (what are hardwares x and y? how was PostgreSQL tunde) is published now, later, or never, is a separate issue. B-) )
      [ Parent ]
    • Re:I do not think it means what you think it means by thanasakis (Score:2) Monday July 09, @03:42PM
    • Re:I do not think it means what you think it means by IdleTime (Score:2) Monday July 09, @05:43PM
    • Re:I do not think it means what you think it means by aliquis (Score:2) Monday July 09, @10:31PM
    • Re:I do not think it means what you think it means by perfczar (Score:1) Tuesday July 10, @10:06AM
    • 2 replies beneath your current threshold.
  • The best way to truly compare (Score:4, Interesting)

    by CaptainPatent (1087643) on Monday July 09, @03:24PM (#19805325)
    (Last Journal: Wednesday April 25 2007, @08:46AM)
    Because Sun systems will always be different from the x86 based cores that run MySQL and Oracle, I think the best way to compare such software would be by constructing servers of equal price and seeing how PostgreSQL fares. The true question on any business person's mind is "how much to implement?"
    • Sun systems will always be different from the x86 based cores that run MySQL and Oracle
      Umm, wrong both ways. Oracle runs really well on Sun SPARC hardware (and I suspect MySQL at least runs), and Sun also makes x86-based servers (built with AMD's Opteron chips). It shouldn't be any trouble to benchmark all three on the same hardware.

      Well, no technical trouble, anyway — I doubt Oracle would like to have its performance compared to two free-as-in-beer competitors. Even if it comes out on top, people will still be tempted to think "Jeez, with the money I save on Oracle licenses, I can buy a faster server and make up the speed difference"...
      [ Parent ]
    • Good, but it can be improved. (Score:5, Interesting)

      by khasim (1285) <brandioch.conner@gmail.com> on Monday July 09, @03:39PM (#19805531)
      Get people from each group, give them the requirements and 5 different dollar amounts.

      Let each team setup their systems how ever they want at each price point. Some will go with clustered servers. Some will go a single monster server. They know their products best so they'll be the ones best suited to choosing the configuration.

      Then run the benchmarks. And keep hammering on them until AFTER the next patch release.

      Yeah, it might run fast, but still be a bitch to patch/upgrade.

      At $5,000 you might find that a cluster of MySQL boxes beats everything.

      At $10,000 maybe something else is best.

      $25,000

      $50,000

      $100,000

      etc.

      And finally, break it. Break it bad. What happens when something goes wrong? Oracle might cost a lot, but if they can come through with your data they might just be worth it.

      If nothing else, you'll get the "best practices" nicely demonstrated by each group. :)
      [ Parent ]
      • by suv4x4 (956391) on Monday July 09, @04:27PM (#19806091)
        Get people from each group, give them the requirements and 5 different dollar amounts.
        Let each team setup their systems how ever they want at each price point. Some will go with clustered servers. Some will go a single monster server. They know their products best so they'll be the ones best suited to choosing the configuration.


        We gave each team $10000 and told them to build the best hardware and db setup they can:

        ** PostgreSQL got a small IBM Blade quad machine redundant setup:
        "We're relying on standard industry solutions and reliability."

        ** MySQL clustered 4 PlayStation3 machines and wasted the rest on booze and women:
        "We're practical, plus we know what is money best spent on!".

        ** Oracle purchased a 1200 square foot datacenter and installed a megacluster of 8132 quad-Xeon 64GB RAM 4TB disk machines. With $10'000...?!
        "We... uhmm... we hit a great bargain, guys! You wouldn't believe it, but it's true!"
        [ Parent ]
      • Re:Good, but it can be improved. by perlchild (Score:2) Monday July 09, @05:28PM
      • Re:Good, but it can be improved. by clambake (Score:2) Tuesday July 10, @05:40AM
    • Re:The best way to truly compare by mooingyak (Score:2) Monday July 09, @03:41PM
    • Re:The best way to truly compare (Score:4, Informative)

      by jhines (82154) <john@jhines.org> on Monday July 09, @03:45PM (#19805593)
      (http://slashdot.org/)
      If you read the details, while being Sun machines, they are Opteron based, so yeah they compare.
      [ Parent ]
    • Re:The best way to truly compare by PCM2 (Score:2) Monday July 09, @04:52PM
  • Bad firehose! (Score:5, Informative)

    Why this emaciated post made it while mine didn't I'll never know...here's how I submitted this story:
     
    The current version of PostgreSQL now has its first real benchmark [ittoolbox.com], a SPECjAppServer2004 [spec.org] submission [spec.org] from Sun Microsystems. The results required substantial tuning [sun.com] of many performance-related PostgreSQL parameters, some of which are set to extremely low values in the default configuration — a known issue that contributes to why many untuned PostgreSQL installations appear sluggish compared to its rivals. The speed result is close but slightly faster than an earlier Sun submission using MySQL 5 [spec.org] (with enough hardware differences to make a direct comparison of those results unfair), and comes close to keeping up with Oracle on similarly priced hardware — but with a large software savings. Having a published result on the level playing field of an industry-standard benchmark like SPECjAppServer2004, with documentation on all the tuning required to reach that performance level, should make PostgreSQL an easier sell to corporate customers who are wary of adopting open-source applications for their critical databases.
    • Re:Bad firehose! (Score:5, Insightful)

      by MrNaz (730548) on Monday July 09, @03:33PM (#19805443)
      (http://www.mrnaz.com/)
      I like yours better. The Slashdot editors need to have their balls cut off if they think the post that beat your onto the front page is better. Feel free to mod me down any time for bitching about this, but seriously, this post is SO much better than the one that made it.
      [ Parent ]
    • DUH! (Score:5, Insightful)

      by Slashdot Parent (995749) on Monday July 09, @04:00PM (#19805785)

      Why this emaciated post made it while mine didn't I'll never know.
      Yours wasn't posted because it didn't contain enough flamebait.
      [ Parent ]
    • Re:Bad firehose! by MythMoth (Score:1) Monday July 09, @04:04PM
    • Re:Bad firehose! by A nonymous Coward (Score:2) Monday July 09, @04:11PM
    • Now THAT is a summary by p3d0 (Score:2) Monday July 09, @05:51PM
  • What are the tuning parameters? (Score:2, Interesting)

    by Anonymous Coward on Monday July 09, @03:30PM (#19805405)
    For those of us who don't have dozens of hours to do the necessary research, can some postgresql gurus sum up some of the most significant tuning parameters so us mere mortals can see similar performance gains?

    I realize that a large part of the answer is going be "it depends on application, your hardware, and you query types", but surely there must be some general tips that we can follow given various typical setups. MySQL, for example, ships with several different configuration files: One suitable for a small installation, one for a mid-sized installation, one for large installation, etc.

    What tuning can someone do to tune postgresql's default (conservative) config file to make it perform better?

  • hardware (Score:1, Offtopic)

    by Deadplant (212273) <deadplant_ca@@@hotmail...com> on Monday July 09, @03:34PM (#19805459)
    The plural of hardware is hardware, not hardwares.
    Does slashdot not have a "check spelling" feature on the submission page?
  • Has anyone used the PostgreSQL open source to refactor the DB to support just a subset of SQL and features (the most popular stuff that eg. "LAMP" uses), then benchmarked it vs the default distro, to show higher performance?

    For that matter, has anyone merged any open source Java server container with PostgreSQL for higher performance of that use case, in an integrated architecture without network and other overhead for messages, and more atomic transactions?
  • by Pap22 (1054324) on Monday July 09, @03:44PM (#19805585)

    This publication shows that a properly tuned PostgreSQL is not only as fast or faster than MySQL, but almost as fast as Oracle (since the hardware platforms are different, it's hard to compare directly). This is something we've been saying for the last 2 years, and now we can prove it.
    Postgresql 8.2 on UltraSPARC T1 [spec.org]
    MySQL 5 on AMD Opteron 285 [spec.org]

    The UltraSPARC has 8 cores on 1 chip and 16GB of memory.
    The Opteron has 4 cores and 8GB of memory.

    The UltraSPARC should smoke it every time.

  • Bias (Score:2)

    by suv4x4 (956391) on Monday July 09, @03:47PM (#19805605)
    They certainly are not unbiased

    I guess that's a deal breake right there, no?

    The test was put together by PostgreSQL core developers at Sun. Didn't we agree earlier, when talking about Intel/AMD benchmarks, that vendor supplied tests are wildly inaccurate?

    PostgreSQL should concentrate on more developer tools and better marketing. The "it's got a ton of features you don't need" on a cryptic site doesn't help its cause.

    People use MySQL because there's a wide support and lots of dev tools for it, and because the kind of people going for MySQL needs to do simple selects and inserts most of the time.
    • Re:Bias by pavera (Score:2) Monday July 09, @04:15PM
      • Re:Bias by Bluesman (Score:2) Monday July 09, @05:57PM
        • Re:Bias by pavera (Score:3) Monday July 09, @09:08PM
      • 1 reply beneath your current threshold.
  • Elephant (Score:4, Funny)

    by suv4x4 (956391) on Monday July 09, @03:50PM (#19805633)
    Won't you guys agree, "elephant" doesn't exactly communicate "fast and modern" very well.
    "Dolphin" comes a bit closer.

    Who's coming up with those logos?
  • performance isn't the issue (Score:1, Interesting)

    by SEAL (88488) on Monday July 09, @03:55PM (#19805703)
    Performance isn't what causes a lack of acceptance in the marketplace for PostgreSQL.

    The problem is twofold:

    MySQL, as others have pointed out, has better developer support and they know their target audience. They supply a fast, easy to use database for those who don't need a whole lot.

    Oracle supplies an enterprise level database that MySQL doesn't aspire to. PostgreSQL doesn't know where to fit in.

    Do a little investigation on setting up PostgreSQL with fault tolerance and replication and you'll quickly see why large corporations cough up money for Oracle. Performance is one aspect of the price tag, but it is certainly not the only factor.
  • Totally unbiased (Score:1, Redundant)

    by Frosty Piss (770223) on Monday July 09, @03:56PM (#19805729)
    (http://www.nojailforpot.com/)

    The test was put together by PostgreSQL's core developers working at Sun.

    No question of bias there...

  • by Pap22 (1054324) on Monday July 09, @04:09PM (#19805879)
    http://en.wikipedia.org/wiki/UltraSPARC_T1#_ref-0 [wikipedia.org]
    Led me to...
    http://blogs.digitar.com/media/2/T2000_Experience. pdf [digitar.com]

    where a UltraSPARC T1 customer states that MySQL 5 is up to 13.5 times faster than MySQL 5 on an AMD Opteron.

    The results of the original article's data were as follows:

    Postresql 8.2 on UltraSPARC T1 - 778.14
    MySLQ 5 on AMD Opteron - 720.56

    So using my blatantly biased (yet at the same time factual) numbers, I correct the MySQL performance number to reflect what it would be on an UltraSPARC T1: 720.56 x 13.5 = 9727.56

    9727.56 > 778.15

    MySQL wins!

  • Which MySQL? (Score:5, Interesting)

    by itsdapead (734413) on Monday July 09, @04:33PM (#19806183)

    MySQL is modular - pick'n'mix data storage engines sharing a SQL front end. I can't find the bit in TFA that says which one they compared.

    I've always suspected that most MySQL vs Postgres flame wars are based on comparing Postgres with the speed of MySQL/MyISAM (No transactions or relational integrity checks - so, big surprise, dead fast for simple queries) and then waving MySQL/InnoDB around when the functionality issue is raised.

    MySQL/MyISAM hits the speed/functionality sweet spot for LAMP data-driven websites, is supported by lots of free webapp software and offered by most decent web hosting services. Comparing it speedwise with Postgres has always been pointless, though. If Postgres has caught up, colour me impressed, but if they're pro-Postgres I bet they're comparing with MySQL/InnoDB (which is a bit closer to like-with-like).

    Never quite seen the point of MySQL/InnoDB really - all the advantages of MySQL/MyISAM minus the speed, support by popular webapps, availbility on low-cost hosts... and still lacks the features of Postgres.

    • Re:Which MySQL? by byennie (Score:1) Monday July 09, @08:14PM
      • Re:Which MySQL? (Score:4, Informative)

        by jadavis (473492) on Monday July 09, @10:10PM (#19809097)
        MySQL is modular [ from grandparent post ]
        The point IS pick'n'mix as you put it. [ from parent ]

        I think this is a huge misconception, and completely backwards. MySQL allows you to change storage engines, but the behavior at the semantic level changes. That's the antithesis of modularity: the semantic behavior should remain constant, while the performance changes. If you change both, that's not modularity, that's a new configuration that breaks client applications.

        MySQL is configureware, like PHP. Everything you get is a trade. Want full text indexes (MyISAM)? You have to give up transactions (InnoDB). But the marketing material always just says "Yup, we have full text indexes (MyISAM), SQL compliance (strict mode=on), transactions (InnoDB), large number of apps (strict mode=off)". Of course many of the features are mutually exclusive. When postgresql says it has a feature, it's really there.

        Just need some in-memory lookups? Memory table engine. Clustered data? NDB.

        Seems like the memory engine and NDB are the same thing: http://dev.mysql.com/doc/refman/5.0/en/mysql-clust er-overview.html [mysql.com]. That means that your "cluster" is not much of a database, and is totally unacceptable for many applications that require a database. Power off == no more data.

        Now compare with PostgreSQL. PostgreSQL has one "storage-engine", but there are many access methods to that storage engine. There's Btree, GiST, and GIN. On top of the access methods, there are also a lot of plans. There's sequential scan, index scan (good for lookups or some sorting needs), bitmap index scan (good for AND/OR with other bitmap index scans, and always orders the I/O in file order), hash join, hash aggregate, merge join, nested loop, group aggregate, etc.

        Look at all those algorithms for accessing the single storage mechanism. It's amazing. MySQL doesn't have all those, and even if it did have the algorithms, it couldn't use them. How would MySQL know when to use a hash join and when to use a merge join? PostgreSQL collects statistics, calculates expected costs, and chooses the best plan based on the given query (called a cost-based planner). MySQL uses a rule-based planner (does it have an index? ok, let's use it then). To PostgreSQL, these two queries are different:

          (1) SELECT * FROM parents WHERE number_of_children=2;
          (2) SELECT * FROM parents WHERE number_of_children=20;

        The stats collector would know that #1 will match many more records than #2. It will probably choose a sequential scan for #1, since it needs to read every page anyway. It will probably choose an index scan for #2. Now, if that's in a subselect, postgresql will know that #1 will return a lot of records, and maybe choose a different join algorithm than if it were #2. Again, PostgreSQL chooses these plans for you based on cost -- no special configuration required.

        If you want modular, it's being able to replace a full text GiST index with a full text GIN index and the application never knows the difference except performance. And by the way, the DDL in postgresql is transactional, so you don't even have to restart the application even if you do some major restructuring of the table (like replacing a table with an updatable view).
        [ Parent ]
    • Re:Which MySQL? by mwkohout (Score:1) Monday July 09, @08:45PM
    • Re:Which MySQL? by Walles (Score:1) Tuesday July 17, @10:03AM
    • 1 reply beneath your current threshold.
  • I once did benchmarking (Score:5, Interesting)

    by Stinking Pig (45860) on Monday July 09, @05:15PM (#19806623)
    (http://www.monkeynoodle.org/)
    I worked for a company whose product ran on MS-SQL, PostgreSQL, and Oracle. Should I explain why we didn't support MySQL or not? It'll draw fanboys either way. I used the same server, reinstalled the OS (Red Hat Enterprise 3 or Windows 2000) and database between each test, and rebuilt the application server to be extra sure.

    Since it was more difficult to write Oracle-compliant SQL and we didn't have a lot of Oracle customers, the developers didn't care to spend time on it, and our stuff ran about 20 percent slower there. That's after a lot of tuning time, it was 50% slower on a default install. Oracle 9 took two days to install and tune, plus another two days of preparation. I was particularly underwhelmed that I had to deal with stupid errors like tarballs that extracted onto themselves and assumptions about the shell being used. At the time, Oracle was a very Solaris-like experience; user-unfriendly to the extreme.

    Postgresql 7 ran great; it was neck and neck with MS-SQL in all tests, after proper tuning, and 30 percent slower on a default install. Postgres took half a day to install and tune, but it took me a week and conversation with the postgres mailing lists to find out what needed tuning. Still, we were able to put together a document that took users from bare metal to RHEL+Postgres in four hours if they had all their media handy.

    Microsoft SQL Server 2000 ran great with no tuning at all, and took fifteen minutes to install. It also cost as much as paying me to do the entire set of tests. OS installation/patching times and tested workloads were the same for all three tests.

    YMMV.
  • by allenw (33234) on Monday July 09, @05:34PM (#19806851)
    (Last Journal: Tuesday October 02, @09:54AM)
    I thought Sun paid Pervasive for their distribution in Solaris 10. Has this changed or by "core developers" do we really mean "people who commit the pkgs to the WOS" or "people who actually work at Sun who also just happen to work on Pg in their free time"?
  • by TrueKonrads (580974) on Tuesday July 10, @02:54AM (#19810487)
    I think this sounds pretty obvious, probably has been done:

    Have an open source suite that allows anybody to verify the test results. Let the experts tweak the configuration for each database. Provide free downloads to databases and/or easy install. This way entire community is tweaking the configurations for different servers and posting back results.

    Not only this would be a more or less "proper" benchmark, but also the secrets of db tuning, if there are any, will be revealed to public. Vendors get to brag if they are in top3, rest get a nice motivation to improve.

    Just my $2,000,000
  • by mahipv (1126147) on Tuesday July 10, @06:20AM (#19811279)
  • by eneville (745111) on Monday July 09, @03:24PM (#19805329)
    (http://www.s5h.net/)

    boys use mysql

    men use PostgreSQL,

    and _____ use MSSQL.

    flame on... =)
    flaming is ok... but stupid. and even more stupid is people who can code only for one db platform.
    [ Parent ]
  • Re:tags (Score:1)

    by CaseCrash (1120869) on Monday July 09, @03:24PM (#19805331)
    Yeah, why the hell is this tag (and others like it) showing up today? It's not coming from jokes in the comments. So what's up with these useless tags?
    [ Parent ]
  • wussy bedwetter MSFT fanbois?
    [ Parent ]
  • Re:on the playground... (Score:1, Informative)

    by Anonymous Coward on Monday July 09, @03:26PM (#19805367)
    and real DBA's use informix..

    like BSD.. no it's not dead yet.
    [ Parent ]
  • Re:on the playground... (Score:5, Funny)

    by CaseCrash (1120869) on Monday July 09, @03:29PM (#19805401)

    boys use mysql men use PostgreSQL, and _____ use MSSQL.
    and people who like to collect a paycheck use MSSQL.
    [ Parent ]
  • Re:on the playground... (Score:3, Insightful)

    by Kalriath (849904) on Monday July 09, @03:36PM (#19805487)
    I dunno, I kinda like MSSQL. Hell, I use it alongside MySQL servers for my own projects (that, and having support for multiple platforms in your product is kinda a good idea). Sure, it's got horrific licensing (nowhere near as bad as Oracle's, though) but other than that, it's pretty good and reliable. I get the impression that the core of it wasn't written by MS way back when, though. And it sure wasn't built by the Windows team.
    [ Parent ]
  • Re:on the playground... (Score:1, Informative)

    by Anonymous Coward on Monday July 09, @03:45PM (#19805587)
    Intelligent people use SQLite (or Berkeley DB) for apps that don't require a heavyweight DBMS.

    Databases are even being used in many situations that would be better addressed using flat files.
    [ Parent ]
  • Absolutely! Of course, they don't really live in the same solution space so it's equally true to say that PostgreSQL is much faster than SQLite for many workloads.

    [ Parent ]
  • Re:SQL sucks (Score:1)

    by mwanaheri (933794) on Monday July 09, @03:58PM (#19805769)
    then you're a good candidate to use an object-database. However, I don't know yet how well they scale. Apart from that, managing concurrent transaction might be a pain. I'm playing with db4o in my next project. Interesting database, but I will restrict it to single-user mode.
    [ Parent ]
  • by malraid (592373) on Monday July 09, @04:23PM (#19806049)
    Just try to hammer each database with 50 concurrent transactions to see which one scales better!!
    [ Parent ]
  • by glwtta (532858) on Monday July 09, @05:23PM (#19806729)
    (http://slashdot.org/)
    I'm sure that's true, but that page is crap:

    "SQLite 2.7.6 is significantly faster (sometimes as much as 10 or 20 times faster) than the default PostgreSQL 7.1.3 installation on RedHat 7.2 for most common operations."

    A drunken badger is 10 to 20 times faster than a default Postgres 7.1.3 installation. The 7.x branch, and particularly the early releases, had pretty bad performance (for this type of queries, at least) - they didn't really start sorting that out until 7.4

    Isn't SQLite a bit of a toy though? Something like HSQLDB or (better yet) Berkeley DB usually seems more appealing when you don't need a standalone DB server.
    [ Parent ]
  • 8.1 automatically does table maintenance (vacuum, stats, etc.)
    http://www.postgresql.org/docs/8.2/static/routine- vacuuming.html#AUTOVACUUM [postgresql.org]

    You can tune it as to when to do such operations, or what max percent of normal I/O can be used for those tasks.
    [ Parent ]
  • Re:VACUUM FULL / VACUUM ANALYZE (Score:3, Informative)

    by Per Wigren (5315) on Monday July 09, @05:33PM (#19806843)
    (http://www.dekadance.se/)

    What am I missing?
    You are missing that recent versions don't need that anymore as it will auto-vacuum for you incrementally in the background. You should still run a "vacuum full analyze" after schema changes though but you usually don't change the schema live on heavily loaded databases anyway...
    [ Parent ]
  • I believe you no longer need to take the database offline and it now has an autovacuum daemon which automatically performs the operation when needed.
    [ Parent ]
  • Re:Tuning (Score:2)

    by turing_m (1030530) on Monday July 09, @06:31PM (#19807331)
    What sort of tables are you using in MySQL... InnoDB or something else? Only if you were using InnoDB tables would it be an apples to apples comparison.
    [ Parent ]
  • Incidentally SQLite also requires regular VACUUMs.
    [ Parent ]
  • 8 replies beneath your current threshold.