Slashdot Mirror


Sun's Mickos Is OK With Monty's MySQL 5.1 Rant

narramissic writes "Back on November 29, MySQL developer Michael Widenius trashed Sun's decision to give MySQL 5.1 a 'generally available' designation in a now-infamous blog post. Widenius warned users to be 'very cautious about MySQL 5.1' because 'there are still many known and unknown fatal bugs in the new features that are still not addressed.' And now we get Sun's response. In an interview Monday, Marten Mickos, senior VP of Sun's database group, said, 'I learned over many years about the benefits and the painfulness of absolute transparency in open source. A little bit of debate never hurts. This is part of being an open-source company. ... People are free to blog about what they want.' Doubtless, this will do nothing to end the debate over whether Widenius will follow fellow MySQL co-founder David Axmark's lead and leave Sun."

155 comments

  1. If they're unknown... by Anonymous Coward · · Score: 0

    ...then how do we know they are fatal?

  2. Re:Uhm by WillDraven · · Score: 4, Insightful

    While I think the AC may be overstating this a bit, I do think the term 'infamous' is being a bit overused here. Ask any random person on the street about this issue and you're probably going to get a response along the lines of "What's MySQL?"

    --
    This is my sig. There are many like it but this one is mine.
  3. Cue Donald Rumsfeld by spiffmastercow · · Score: 2, Funny

    prepare to hear about known unknowns

    1. Re:Cue Donald Rumsfeld by Pvt_Ryan · · Score: 1

      yes, you must expect the unexpected grasshopper

  4. Thirsty for a frosty one by Anonymous Coward · · Score: 0, Funny

    A while ago, while browsing Sun's downtown website, and had to take the piss. As the java plugin loaded, I

  5. Re:Uhm by philspear · · Score: 3, Interesting

    So tell us, what exactly IS yourSQL?

  6. Transparency by webword · · Score: 1, Funny

    If code's too transparent you see right through it to the bloody programmers and their coffee and Monster drinks. In fact, you might see into their dark hearts. You'll see little Guitar Heroes and Battlestar Gallacta action figures. Maybe even, gasp!, some Natalie!

    Transparency? Shudder!

  7. Re:Uhm by Random+Street+Person · · Score: 2, Funny

    What's MySQL?

  8. Debate? by FranTaylor · · Score: 4, Insightful

    What is the debate? MySQL releases with known crashing bugs. Noone is disputing that.

    Is the debate over whether or not it is okay to ship a database with known crashing bugs?

    It really surprises me to hear someone from Sun saying that one can debate the merits of a crashing database. If this is the expected level of performance from MySQL, no wonder people shun it. At the very least they could have called it a beta or rc release, that would set the expectation level at something approaching reality.

    1. Re:Debate? by ruin20 · · Score: 3, Informative
      From what I could tell the debate was over how serious the bugs were and how they should or shouldn't be allowed into something that is an official release.

      Monty went beyond that to suggest that all the company talent was going toward other projects instead of MySQL and that was hurting the quality of the project. So it doesn't seem to be so much about where the quality bar is set and how the company is managed rather than over the existence of bugs. Some of it might be because there isn't a strong enough grasp of how the product is being used to allow for people to make those kinds of value decisions.

      More importantly though it's impressive to see a company realize that instead of trying to squelch their development people, letting them say what they want and contribute to the conversation rather than telling them to shut up and get in line is rather impressive. The idea that open source means more than just disclosing code is a key part of becoming a member of the community and it seems like a culture shift in Sun's thinking. Definitely progressive from 5-10 years ago, when this would have been unthinkable.

      --
      Oh honey look... How cute... an angry slashdotter!
    2. Re:Debate? by sleeponthemic · · Score: 1

      Is this unacceptable? Maybe, maybe not. Surely people rarely rely on latest versions of DBs for production code. I'm not in the DB biz any more (and I wasn't really heavily into it when I was) but it seems to me you can't afford to be taking risks, using the latest versions.

      --
      I record my sleeptalking
    3. Re:Debate? by iminplaya · · Score: 2, Informative

      Sun may be more "progressive" than some, but this statement from the article clearly reveals who's running the show:

        "...There were still some outstanding critical bugs, and Marketing and Sales were pressing for a release," Maxia added.

      This was "understandable," he said. "The economic situation of Sun was not good, the company had just cut 2,500 jobs, and we needed the new release to boost sales.

      Seems to confirm the original complaint.

      --
      What?
    4. Re:Debate? by Z00L00K · · Score: 1

      It's not debating about a crashing database, but allowing a voice to be heard and not silenced.

      There are certainly problems, but there will always be yet another bug no matter how hard you try. And let them be open about it.

      If you like ignorance - stick with closed vendors like Microsoft.

      What may be debated is if it was pushed into GA too early, and maybe it was. But don't shoot any messengers about that. The real benefits from this is that developers will know more about the issues and can work to solve them or circumvent them.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    5. Re:Debate? by datacharmer · · Score: 2, Informative

      Seems to confirm the original complaint.

      Please read carefully the next statement in the article.
      After that phase, there were a lot of bug fixing before Community and Support agreed to a release. (or read the original article)

      G.M.

    6. Re:Debate? by fitten · · Score: 1

      Is the debate over whether or not it is okay to ship a database with known crashing bugs?

      Sure it is. Especially if you're bleeding money. Since it's OSS, you can just throw it out in whatever shape it's in and you'll have a wonderful army of programmers who will fix your bugs for you.

  9. Re:Uhm by Anonymous Coward · · Score: 5, Insightful

    We use MySQL in a number of critical aspects of our company. I'd rather have a company be honest and let me know I might have some issues with this new release than pretend there are no issues. That lets me stay with my current version and upgrade later.

    Rather be on the stable blunt edge in critical infrastructure, not the bleeding edge.

  10. Re:Uhm by moderatorrater · · Score: 4, Funny

    iSQL

    50% more pretentious, runs all the coolest sites in the world.

  11. MySQL join performance deficiency, 2 orders of mag by nluv4hs · · Score: 5, Interesting
    My subject line sounds inflammatory yet see below for hard numbers and a simple, real example. Someone please show me how to coax MySQL to perform as well as PostgreSQL for this simple query (Postgres 496 times faster). It's been over two months since I posted this problem on two very public forums, with no response from the MySQL community. Would someone please stand up for MySQL and save it from looking weak here?!
  12. there's other SQL database programs... by amclay · · Score: 0

    I like postgreSQL, though mySQL is certainly very nice.

    --
    It's all fun and games till someone divides by 0. Then it's hilarious.
    1. Re:there's other SQL database programs... by danbeck · · Score: 0, Redundant

      I like postgreSQL, though mySQL is certainly very nice.

      juST becAUSE postgreSQL hAS fuNNY cAPS doeSN't meAN evERY thING elSE usES iT tOO.

    2. Re:there's other SQL database programs... by amclay · · Score: 0

      ha ha ha. courtesy laugh? it's "MySQL and PostgreSQL" I just didn't capitalize the first letter.

      --
      It's all fun and games till someone divides by 0. Then it's hilarious.
  13. Sellouts by Anonymous Coward · · Score: 0

    and this is exactly what can happen when you sellout (your soul) to <large failing company> *

    * read: Sun, Microsoft, Oracle, EA, etc.

    1. Re:Sellouts by jadavis · · Score: 1

      You're way off base. Here's what Monty said:

      I would like to point out that the current release is not something that can be said to be fault of Sun. The decisions to do a GA release was solely been made by the MySQL management in Sun. The only thing Sun can be blamed of is to not start fixing the MySQL development organization soon enough to ensure that things like this can't happen.

      What should Sun have done to make this release better? By the time Sun purchased MySQL, it was already way behind the release schedule, and had serious problems. Should they have delayed it further and made it a 5-year gap between GA releases?

      Also, releasing with known bugs is a known problem for MySQL anyway. The only reason it's news now is because:
        * They took 3 years to do a release, over a year in RC phase, and it's still got major problems.
        * People can't believe that MySQL still hasn't stabilized their product.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
  14. To their credit by coryking · · Score: 4, Insightful

    MySQL has never been a stable database program. I've never had any other database system that just blows a database table at random. Nothing is more exciting then having a website go down because one of the tables got marked "corrupt" and you have to go "REPAIR TABLE". The damn thing might not even have a load on it and it will blow up!

    First of all, what is MySQL doing that corrupts tables during normal operation and second of all? Seriously, a database shouldn't crash like that, ever.

    Second of all, it might as well try to auto-repair the damn table. I mean, I've never had it loose data, only somehow decide the table was "corrupt" and then taken offline. And who cares if you do it automatically and it looses data, this is MySQL we are talking about here! They make no claim about data integrity and the user base doesn't even know what that means (must be a car or some "enterprise" feature used only by NASA and Fortune 50 companies)! I mean, 0000-00-00 is a valid date according to them!

    But alas, this is MySQL we are talking about here. I mean, it isn't like you are putting any sensitive data on it right? I mean, surely only a fool would use it for anything besides storing data like "number of shoes in my closet" or "number of purses owned by the wife", right?

    Good 'ol MySQL. I mean, what fun is a database server that is consistent or predictable?

    1. Re:To their credit by larry+bagina · · Score: 1

      I don't know what it's doing, but I know what it's not doing: ACID.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    2. Re:To their credit by LCValentine · · Score: 1

      Loose data are hot... just like slots.

    3. Re:To their credit by carlzum · · Score: 4, Informative

      If you consider InnoDB part of MySQL, then it has supported ACID compliant transactions for a while now.

    4. Re:To their credit by dkleinsc · · Score: 0, Flamebait

      The problem, in my opinion, is that a lot of folks have become convinced that MySql is an absolutely essential part of a web application that runs on Linux and Apache. It's getting used largely because it's part of the LAMP stack that some boss has heard a few things about.

      Having used both MySql and several real databases (postgres, Oracle, even MS SqlServer) throughout my career, I have yet to figure out what MySql's appeal really is. It's like the PHP of databases: it was one of the first to enter the game of open database options, and so a lot of people use it despite causing lots of grief.

      --
      I am officially gone from /. Long live http://www.soylentnews.com/
    5. Re:To their credit by domatic · · Score: 2, Interesting

      MySQL has never been a stable database program. I've never had any other database system that just blows a database table at random.

      I see you've never tangled with FileMaker Pro.

    6. Re:To their credit by QuietLagoon · · Score: 4, Interesting
      MySQL has never been a stable database program.

      . (5 insightful???) Well thats kind of harsh.

      I've run MySQL datase servers on my websites for nearly 10 years without one problem. Tens of thousands of hits per day. No problems. MySQL is always there, and always working.

      I only can wish that my desktop Windows were one-hundreth as reliable.

    7. Re:To their credit by Sentry21 · · Score: 5, Informative

      Sounds like you were using MyISAM. InnoDB will find and detect corrupt pages - and considering that pages get written into the doublewrite buffer, then written to the log, then written to the tablespace, it's fairly unlikely that things end up corrupt without some kind of disk-related issue.

      It doesn't auto-repair table because there can be several issues that could cause that to be a bad idea - for example, a broken RAID controller or faulty disk. If your disk is losing writes sporadically (which I've seen happen), then you'll move from a few corrupt records to a swath of corrupt records.

      Re: the date thing, the philosophy was that it's not the database's job to validate data. You could use -00-00 to refer to an all-year event in some kind of astronomical calendaring system, for example, or 0000-mm-dd to refer to something that happened 2008 years ago. If you really want to limit it to a specific range of dates, then you can tell MySQL that, and you can enforce it in your application (or in a trigger, for that matter).

      Your rant would have been very apropos ten years ago; nowadays it sounds like you're just holding a grudge because you don't know how it works or what it does.

    8. Re:To their credit by trawg · · Score: 1, Insightful

      Why do I never have mod points whenever MySQL threads come up?! good post.

    9. Re:To their credit by wytcld · · Score: 3, Insightful

      Must be in YMMV territory here. I've been running MySQL behind production Web servers for years, through many iterations of MySQL. I've not once had it "blow a table." No doubt that's been your experience. But I have to wonder if it was MySQL that was the weak point in your configuration.

      I've found, and reported, bugs in years past. Those were all in peripheral capabilities though, not in basic data handling. MySQL was always good about addressing them. Haven't hit any since Sun took over.

      --
      "with their freedom lost all virtue lose" - Milton
    10. Re:To their credit by larry+bagina · · Score: 2, Insightful

      There is no year 0.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    11. Re:To their credit by StuartHankins · · Score: 3, Interesting

      I'm not having any troubles, and I populate several million records each day spread across approx 100 tables without error. I've done this for several years.

      I happen to be in a situation where the host system isn't ODBC-compliant so we hosted MySQL on the same box and use custom code to get data out of it. Then I import from MySQL into MS SQL Server. It's very quick for what I do and I haven't had to spend time on maintenance and tuning really like I do MS SQL Server. No table partitioning yet, no manual placement of indexes on separate filegroups etc. Oh, and no data loss. And while it's importing / exporting the MySQL load on the server is minimal -- I'm accustomed to seeing it 90%+ idle at that time of the morning.

      Granted, I use a small portion of its features, but even things like the ability to load data and have it either replace or append as needed saves another pass per table. With my tiny maintenance window this really helps.

      YMMV though. Maybe because I stay a version behind bleeding edge (5.0/5.1) it helps?

    12. Re:To their credit by fibrewire · · Score: 1

      Clearly "coryking" was making a reference to the reliability of how awesome MySQL really is, and how ridiculous it is to have a company like Sun try to say "If it breaks, then we fix it" to the FOSS community. Its exactly that kind of thinking that put FOSS where it is today.

      For example, imagine that Microsoft and Sun are GM and Ford 20 years ago, and that FOSS is Honda. Everybody points and laughs at the little box that could, what a great idea - but people don't want reliability, they want features. But now because unforseen turns in the economy, an informed general public, and Honda's ability to place Marketing ***BEHIND*** the Scientific Method, GM and Ford are left scratching their head, wondering what happened to their plan to rape consumers. And now the great American motor companies need a few hundred billon dollars of OUR friggin money to pay for their mistakes, while Honda is now the gold standard. Are we to make the same mistake with FOSS?

      Now put the CEO's of GM behind the wheel of Honda. You expect the Honda engineers to WHAT? Screw the consumers and make the model year release date! WHAT!

      If only Hondas were free... a guy can dream...

    13. Re:To their credit by fatp · · Score: 2, Informative

      But InnoDB is very slow. This contradicts with the claim that MySQL is fast.

      MySQL has all the nice features any commercial enterprise level RDBMS has. The problem is that you can't use them together.

    14. Re:To their credit by Anonymous Coward · · Score: 0

      So long as your query is MySQL transaction compatible. You cannot for example create/drop/alter a table in a transaction. I don't understand why they can get away with claiming ACID compliance when only a subset of possible queries can be done in a transaction. Of course PostgreSQL makes no distinction, everything except maybe CREATE DATABASE can be done in a transaction from my experience.

    15. Re:To their credit by blind+biker · · Score: 2, Insightful

      I have been criticizing MySQL for years, because of what I perceived as awful stability. I would be the last one to defend them.

      That said, MySQL has never ever crashed for me. Not once. But my usage scenario is one of very light load. That seems still more traffic than "The damn thing might not even have a load on it and it will blow up!", so, maybe (please don't get mad, just an idea, OK?) there is a chance that your configuration is in some way contributing to this?

      --
      "The agriculture ministry is not in charge of Gundam" - Japanese ministry official.
    16. Re:To their credit by ortholattice · · Score: 2, Insightful

      You could use -00-00 to refer to an all-year event in some kind of astronomical calendaring system, for example, or 0000-mm-dd to refer to something that happened 2008 years ago.

      Wow, I am speechless. This is one of the best attempts to turn a bug into a feature I've seen in years! You should work for MySQL's marketing department. Now I'm really excited to hear about the creative things one can do with Feb. 31st...

    17. Re:To their credit by Jellybob · · Score: 2, Interesting

      I think people are blowing this out of proportion, but in 5 years of using MySQL, I've seen it happen twice.

      Once was on a personal site I didn't really care about, the other time was on a site getting tens of thousands of requests an hour. As other people have said, there really is no excuse for dying like that.

    18. Re:To their credit by Anonymous Coward · · Score: 0

      I've run MySQL datase servers on my websites for nearly 10 years without one problem.

      That's an anecdote, not data. Just because YOU didn't happen to run into bugs in YOUR particular application and with YOUR particular workload on YOUR particular iron doesn't mean they don't exist.

    19. Re:To their credit by MikeBabcock · · Score: 4, Insightful

      I'm sorry, I forgot that many developers expect their storage engine to BE their application instead of writing good code themselves.

      Shouldn't you be validating your dates or numbers or other values BEFORE sending them to your storage system? Shouldn't the database's job be to store your data in a logical fashion so its easy to find later, and then find it when you query it?

      I don't understand people who expect the database to replace the middleware of their application.

      --
      - Michael T. Babcock (Yes, I blog)
    20. Re:To their credit by MikeBabcock · · Score: 2, Insightful

      The only time I've blown a table, I did something stupid to the filesystem MySQL was running on while MySQL was still running.

      I might add, I've been using MySQL since before InnoDB, when it was a glorified query engine for flat files.

      It would seem to me that many developers are lazy and expect their tools to do the work for them. People who complain about some of the little MySQL issues (like date ranges) wouldn't be able to write a working C program with compiler errors disabled.

      And yes, I think the latter is valid -- if you depend on the compiler to catch your errors, you're still CREATING errors.

      --
      - Michael T. Babcock (Yes, I blog)
    21. Re:To their credit by Just+Some+Guy · · Score: 2, Interesting

      I've run MySQL datase servers on my websites for nearly 10 years without one problem.

      I think the discriminator is the ratio of reads to writes. If it's read-mostly with just a few updates here and there, MySQL can (probably) go a long time without serious data corruption. I would absolutely not recommend it on a site with many update. Slashdot, for example, is in the former category. At say 20 stories per day with maybe 200 posts per story, that's only 4,000 insertions to the comments tables. Since it doesn't allow editing, there are no updates involved. I'll throw in another 10,000 moderation events. Now, compared to Slashdot's huge viewing traffic, that's practically read-only.

      Tens of thousands of hits per day.

      On a site that slow, you (probably) won't see corruption any time soon.

      --
      Dewey, what part of this looks like authorities should be involved?
    22. Re:To their credit by Just+Some+Guy · · Score: 2, Interesting

      I've not once had it "blow a table." No doubt that's been your experience.

      Here's my problem: the fact that it's even a debating point indicates that it happens way more often than should be tolerated in a database of all things. When people talk about PostgreSQL, they gripe about the (supposed?) lack of replication, but no one complains that they've lost data to it. Same with Oracle: no one loves the price, but it works. SQL Server: hate the lockin, but it works. Even SQLite: not very concurrent, but it works.

      That is the reason why I don't recommend MySQL. A database should work 100% of the time, for everyone, and discussion should revolve around features or price or support. It should go without saying that it never loses data. That's just not something you should ever even have in the back of your mind.

      --
      Dewey, what part of this looks like authorities should be involved?
    23. Re:To their credit by Slashdot+Parent · · Score: 2, Interesting

      Any database can experience data loss. That includes Oracle, SQL Server, and even your beloved PostgreSQL. This can happen for any number of reasons, including (but not limited to) hardware failure, power failure, user error, etc.

      Postgres isn't going to help you if you forget a WHERE clause. Oracle isn't going to help you if your RAID is corrupted.

      FWIW, I have never had a MySQL database lose data, and I have committed more "user errors" than I'd like to admit. Hell, I once pulled up the wrong window and moved the frickin' database file right out from under a running MySQL server to another volume. No data loss.

      Also FWIW, it is possible to experience data loss with Postgres, where it is Postgres's fault (as opposed to the RDBMS not being able to recover from some external fault). Example 1. Example 2.

      --
      They don't grade fathers, but if your daughter's a stripper, you fucked up. --Chris Rock
    24. Re:To their credit by slippr · · Score: 1

      Thank you. My goodness, I'm so glad that someone has mentioned this. You should never, ever, ever blindly store data in your database without validating it first.

    25. Re:To their credit by Just+Some+Guy · · Score: 1

      Any database can experience data loss. That includes Oracle, SQL Server, and even your beloved PostgreSQL. This can happen for any number of reasons, including (but not limited to) hardware failure, power failure, user error, etc. Postgres isn't going to help you if you forget a WHERE clause. Oracle isn't going to help you if your RAID is corrupted.

      But none of those are failures of the databases themselves. I won't blame MySQL if a meteor takes out the data center. I'll blame the heck out of it when I get "Table 'FOO' is marked as crashed and should be repaired" for no apparent reason.

      FWIW, I have never had a MySQL database lose data

      I don't doubt you at all, but my point is that it's happening to some people often enough that people are talking about it. That's wholly unacceptable.

      Also FWIW, it is possible to experience data loss with Postgres, where it is Postgres's fault (as opposed to the RDBMS not being able to recover from some external fault). Example 1 [juniper.net]. Example 2 [postgresql.org].

      Example one was fixed in 2002. Example two only crops up when you've inserted more than 4Gigarows without the (once a minute) autovacuum daemon cleaning up a table. Furthermore, "If for some reason autovacuum fails to clear old XIDs from a table, the system will begin to emit warning messages like this when the database's oldest XIDs reach ten million transactions from the wraparound point [...] If these warnings are ignored, the system will shut down and refuse to execute any new transactions once there are fewer than 1 million transactions left until wraparound". Even in the worst case, PostgreSQL avoids data loss.

      I think you might want better examples next time.

      --
      Dewey, what part of this looks like authorities should be involved?
    26. Re:To their credit by PitaBred · · Score: 1

      Lose. When data goes bye-bye, you lose it. Loose is what your lips are if they're sinking ships.

    27. Re:To their credit by Slashdot+Parent · · Score: 1

      But none of those are failures of the databases themselves. I won't blame MySQL if a meteor takes out the data center.

      Actually, what you said was "A database should work 100% of the time, for everyone, and discussion should revolve around features or price or support. It should go without saying that it never loses data. That's just not something you should ever even have in the back of your mind.", and I was bringing up those other failure modes to reinforce the fact that you should always have data loss in the back of your mind.

      No one is offering you a 100% guarantee that when you put data into your RDBMS, you will necessarily be able to get it out. This is why god invented backups, binary logs, point in time recovery, etc. Even your beloved PostgreSQL has an entire facility for Backup and Recovery. ;)

      I'll blame the heck out of it when I get "Table 'FOO' is marked as crashed and should be repaired" for no apparent reason.

      If you are going to chastise me for bringing up older pg examples, you are going to need to start talking about InnoDB. MyISAM made some design choices to favor speed and simplicity over data consistency, and this fact is not in dispute.

      InnoDB will not randomly tell you your table is corrupt and lock you out until you issue some weird command.

      I think you might want better examples next time.

      OK, here are over 70,000 of them: http://www.google.com/search?q=postgresql+data+loss.

      What did you say your point was, again? "That it's happening to some people often enough that people are talking about it."? ;)

      Any database might, for one reason or another, eat your data. I'm not sure why you insist upon acting so surprised at this fact of life.

      --
      They don't grade fathers, but if your daughter's a stripper, you fucked up. --Chris Rock
    28. Re:To their credit by Anonymous Coward · · Score: 0

      It would seem to me that many developers are lazy and expect their tools to do the work for them. People who complain about some of the little MySQL issues (like date ranges)

      So you expect every application to do its own validation of leap years then?
      What about foreign keys?
      Unique constraints?

      Sounds like you'd be better off with a flat text file rather than a database.....

    29. Re:To their credit by Anonymous Coward · · Score: 0

      If you are storing data in a database column defined as a DATE data type, then the database should damn well validate the data before inserting/updating the record. This has nothing to do with the application.

      You're probably one of those developers that define all of their database columns as char/varchar data types so that you can easily store any type of data you choose aren't you?

    30. Re:To their credit by jlechem · · Score: 1

      Are you serious? There should never just be one stop for detecting shit input. Code should check for it and the database shouldn't allow storing of it. At least if the database stops it and someone forgets to code it because they're obviously not as good as you are they're not completely fucked.

      --
      Hold up, wait a minute, let me put some pimpin in it
    31. Re:To their credit by Safety+Cap · · Score: 1

      At least if the database stops it and someone forgets to code it because they're obviously not as good as you are they're not completely fucked.

      Did you at least ask to subscribe to his newsletter? There's nothing quite as exhilarating as expecting the data to be pristine (it is called "ACID" compliance for those of you who've only ever used MySQL) and then some other guy comes along and adds a new method to your model and ... WHOOOPS!

      Sorry, Bud. You know all 100,000s of those customer transaction records? Well somehow they all have a date of Feb 31st...

      --
      Yeah, right.
    32. Re:To their credit by MikeBabcock · · Score: 1

      Its interesting how you think a foreign key has anything to do with validating stored data before putting it into a database.

      Of course, I know you're just talking out of your alternate orifice to make a point, and more power to you, but yours is completely invalid.

      You made no point, and gave no reason as to why validation of dates should be done by the underlying database system.

      Do I expect you to use a language or library capable of basic date manipulation when writing software? You bet I do. Do I expect you to validate data even IF the underlying database system does it? Yes. Trusting the DB layer to do data validation is like trusting your bank to handle your money without a chequebook to validate against.

      --
      - Michael T. Babcock (Yes, I blog)
    33. Re:To their credit by MikeBabcock · · Score: 1

      If your app stuck a date of Feb 31st in a customer's record, then your App is to blame. Jeez.

      --
      - Michael T. Babcock (Yes, I blog)
    34. Re:To their credit by bill_mcgonigle · · Score: 1

      People store Pope Gregory's date format in their databases? Geez, people, get with the program next time().

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    35. Re:To their credit by bill_mcgonigle · · Score: 1

      OK, here are over 70,000 of them: http://www.google.com/search?q=postgresql+data+loss [google.com].

      I've been meaning to blog on bad stats pulled from bad google searches based on a conference I was at recently where this was rampant. But anyway, you need to at least join "data.loss" to search on the phrase, which changes the result to 39500, but even at that there is a bunch of irrelevant stuff.

      So, if we go for the whole phrase: "postgresql.data.loss" we get 722 hits. Just for grins, "mysql.data.loss" is 893 today. Neither are meaningful metrics.

      Me, I just got done waiting 22 hours for a mysql slave to catch back up after it broke its own replication. Again.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  15. Re:Uhm by aliquis · · Score: 3, Funny

    If there really was an iSQL it would cost money, decide which SQL statements you wanted to run and how to run them, have no export to other databases but come in a really really flashy box.

  16. Re:Uhm by philspear · · Score: 2, Funny

    Uh... I didn't know yourSQL was actually a thing, I was trying to make a joke.

  17. Re:Uhm by Kneo24 · · Score: 1

    So tell us, what exactly IS yourASL?

    Fixed that for ya.

  18. Re:MySQL join performance deficiency, 2 orders of by uss_valiant · · Score: 3, Interesting

    I'm not really touching this potato, maybe you're running into some quirks / unfortunate query. Just some quick questions:
    - Why don't you have a PK / any index in the address table?
    - Did you try a different syntax (e.g. WHERE vs. JOIN ON)?
    - Did you try setting different indexes? Tried forcing a specific index?

  19. Re:Uhm by carlzum · · Score: 3, Funny

    Why yes, there is an iSQL, though it's a command-line client tool for MS SQL. But it does meet all of your criteria.

  20. Same old, same old by Anonymous Coward · · Score: 1, Interesting

    Sun buying MySQL is no different than Microsoft buying FoxSoft. Fox Software created Foxpro, a dBase-like database system. Not a true database, but something you could put a lot of data into. Fox Software sold Foxpro to Microsoft. Microsoft already had (has) MSSQL. First release after Microsoft got their hands on it: it could only store 1/500 as much data as before, and suddenly it got slower. It isn't completely dead yet, but no development has been done in 14 years. So its exactly like Sun and MySQL -- Sun bought MySQL to kill it.

    1. Re:Same old, same old by /dev/trash · · Score: 4, Insightful

      Except that mySQL is open Source, how can they kill the copy that I have on my hard drive and can re-distribute?

    2. Re:Same old, same old by KingMotley · · Score: 1

      Foxpro was more along the lines of Access, and it was specifically bought for one of the query features it had. The next Access release had incorporated that technology, and quite honestly was a much better GUI system than foxpro ever was. Foxpro was never a scalable solution, and suffered the same problems access did.

    3. Re:Same old, same old by Anonymous Coward · · Score: 0

      If no one takes up the reigns then it is as good as dead though. With something as large and buggy as MySQL you won't find many people willing or even capable of taking on something like that.

    4. Re:Same old, same old by jvkjvk · · Score: 1

      Oh, they can't take the OLD version away from you. But the NEW version could be completely craptacular. Lack of new features. Slow down development. Don't fix bugs. Half hearted support.

      Sure it's open source and other people could do all of those. But if they don't, it doesn't happen. With a business sponsor such as Sun, there are quite a few less people willing to give their effort to ultimately help out a for profit company.

  21. Re:Uhm by Anonymous Coward · · Score: 1, Funny

    What's MySQL?

    A child Process!

    Puns: Never explain, never apologize.

  22. crashing database == lost data by FranTaylor · · Score: 2, Insightful

    If your database is crashed and is no longer capable of accepting data, how is that different from losing data? Go ahead and explain that with a straight face. Do they have another data store where you can keep your data until the database is fixed?

    Sun should be ashamed of themselves for even calling this abomination a database in the first place. The word 'database' carries a whole host of expectations that the product simply does not live up to. A text file makes a better database than MySQL.

    1. Re:crashing database == lost data by multipartmixed · · Score: 4, Insightful

      > If your database is crashed and is no longer capable of accepting data, how is that
      > different from losing data? Go ahead and explain that with a straight face.

      Well, for example, losing bank deposits is a lot worse than not accepting them because the database is down. This illustrates why in database land it's important to never lose data, and to always know that the contents of your database is correct.

      Or, to explain in more detail...

      There are known knowns.
      There are things we know we know.
      We also know
      There are known unknowns.
      That is to say
      We know there are some things
      We do not know.
      But there are also unknown unknowns,
      The ones we don't know
      We don't know.

      And the unknown unknowns are most dangerous when it comes to RDBMS integrity.

      --

      Do daemons dream of electric sleep()?
    2. Re:crashing database == lost data by wik · · Score: 1

      Good to see Rumsfeld invoked to explain databases. It really warms my heart.

      If only he had remembered the unknown knowns--the data your DBMS just lost--the set would be complete.

      --
      / \
      \ / ASCII ribbon campaign for peace
      x
      / \
    3. Re:crashing database == lost data by reynolds_john · · Score: 1

      Donald Rumsfeld, is that you?

      http://www.youtube.com/watch?v=_RpSv3HjpEw

  23. Re:Uhm by jaxtherat · · Score: 1

    Only if you pronounce it MySEQUEL.

    --
    http://www.zombieapocalypse.tv/
  24. What terrible expectations! by FranTaylor · · Score: 1

    It's impressive that a company ships junk and admits it? Since when is that impressive? Boy are you setting the bar low.

  25. We are in a post-rational debate by coryking · · Score: 2, Insightful

    If your database is crashed and is no longer capable of accepting data, how is that different from losing data?

    I mean this is mysql here, not a real relational database. Kind of like sloppy cowboy VB coders of yore, MySQL has the same kind of attitude. "If it works, who cares if it is right".

    I mean, sure people site "Well, Slashdot, FaceBook, and BIGCO use it, so MySQL is okay". But have those people ever realized how easy it is to lock yourself into MySQL? MySQL is so full of non-standard behavior and gotchas that it can be very painful and difficult to migrate to a real database. So what to companies do? Layer on a huge pile of Memcached and crazy "archive databases" to scale when if they had started with a more standard, scalable database system maybe they could have allocated their developer time to something more productive.

    Anyway, I rant. I just think MySQL is only used by large companies because either they don't understand how much extra developer hours are spent working around MySQLisms or they know MySQL sucks, but know that it is to costly to migrate to something better.

    But that has nothing to do with your post or my original post does it? I'll conclude with the main problem--Like VB, MySQL grew a whole crop of developers who dont know any better. While I dont know if you can blame that on the database or a programming language, I chuckle when I see MySQLisms in code (like never using a "JOIN" because it mysql is "faster if you give it small SELECT statements).

    /Rant Off

    1. Re:We are in a post-rational debate by crucini · · Score: 1

      I work at BIGCO. Everything you say is partly true, but:

      I've developed apps on Oracle and MySQL. Cost is not a factor; we get Oracle for free here. And yet I always choose MySQL for new projects. And that is the overwhelming majority preference, among experienced engineers who disagree on lots of other things. Why?

      1. Performance. Even with good DBAs investing a lot of time, Oracle cannot deliver. Remember, we tune our schema and MySQL instance until it's faster than many custom-written datastores. (Obviously, I'm talking about MyISAM). MySQL is so fat-free that it's hard to beat in custom C. And yes, MySQL's performance falls off rapidly with complex queries. Query optimization does consume significant engineering time.
      2. Hassle factor. Just as you feel MySQL has imposed too much weirdness on you, I feel that Oracle has wasted too many of my hours. Everything about this db is clumsy, old-fashioned and obscure.
      3. Transaction-phobia. We're not doing banking apps here. I remember Oracle instances getting slow because open sessions are piling up, either from humans, broken pooling, or scripts. One more headache I'm thankfully free from.

      There's no free lunch here. Oracle provides a more seamless abstraction, including ACID, at the price of performance. That is an appropriate tradeoff for some apps.

    2. Re:We are in a post-rational debate by juuri · · Score: 1

      (like never using a "JOIN" because it mysql is "faster if you give it small SELECT statements).

      This isn't entirely accurate. And surely not what MySQL themselves recommend. I attended their high performance tuning class earlier this year and there was extensive talk of using Joins and Table Views in 4.x+ because it *was* much faster. Both are expected to be even more improved in 5.X so they want developers to start using them now.

      You really shouldn't blame MySQL for the hordes of new developers who are just sloppy. It's sort of like this huge array of open source apps created in the last few years that only build on Linux. This isn't the fault of linux, just what we get from having a core group of new developers who weren't schooled or learned in the ways of old. Good enough to ship, is what we are stuck with.

      --
      --- I do not moderate.
  26. Nice by coryking · · Score: 3, Insightful

    But what happens if you want to do full text search? Besides, your nice ACID InnoDB kinda backfires when half the tables are using MyISAM, doesn't it? And good thing MySQL lets you know when your nice happy transaction will not roll back properly because half the tables are MyISAM, right?

    As I said, what fun is a database server that is consistent or predictable?

    1. Re:Nice by theantix · · Score: 1

      Full Text Search does not belong in a relational database engine. None of them do it well compared to dedicated FTSE like Sphinx Search or Lucene, not Postgres, not MyISAM FULLTEXT, and not Mssql.

      Thus only consider InnoDB for MySQL data storage, it supports transactions, FK support, and safe crash recovery.

      --
      501 Not Implemented
    2. Re:Nice by Safety+Cap · · Score: 1

      None of them do it well compared to dedicated FTSE like Sphinx Search or Lucene, not Postgres,

      We users of Tsearch2 will vehemently disagree with you.

      --
      Yeah, right.
  27. Jimmy Two Times by iminplaya · · Score: 1

    "...And the bugs got fixed and then we moved on. We moved on."

    --
    What?
  28. Re:MySQL join performance deficiency, 2 orders of by Antony+T+Curtis · · Score: 4, Informative

    You're probably not going to like this answer but....

    The data is not in an optimal form for MySQL. Consider storing the IP address as a BINARY CHAR field, and not as a number. Order the bytes so that it is in big-endian byte order. Now MySQL can use it's indexes.

    The problem is that MySQL treats index keys as a binary string so if you are using a function to join two tables, MySQL does things the hard way.

    --
    No sig. Move along - nothing to see here.
  29. Re:MySQL join performance deficiency, 2 orders of by nluv4hs · · Score: 2, Informative
    Thank you for these thoughtful questions.
    1. The example setup is intended as a minimal demonstration, so I left out any keys on address.
    2. I played a lot with where clauses, with no benefit. Anyway, shouldn't an industrial-strength RDBMS be able to interpret and optimize the simplest possible range join written as such?
    3. I configured the strongest possible indices on range: 2 unique, 1 non-unique. Yes I tried FORCE INDEX, it made no difference (in execution time or EXPLAIN output).
  30. Re:MySQL join performance deficiency, 2 orders of by JambisJubilee · · Score: 2, Interesting

    I can also make a query which makes MySQL look better the PostgreSQL. What's your point?

    Okay... so what's your query?

  31. Re:MySQL join performance deficiency, 2 orders of by Shados · · Score: 4, Informative

    The problem with this scenario and why it will always bother people who are used to non-MySQL RDBMS, is that really, you haven't had to think about things like that in a decade (more if you were giving your first born to Oracle).

    Equivalent where vs joins should give similar query plans. If not, since the SQL standard where JOINs are first class citizen state that its what you should use for linking tables (no matter how exotic the JOIN), it should handle that better, and having to force an index is usually a crutch (even Microsoft will often consider it a bug, and the logical scenarios get fixed between versions... in 2000 you had to force em every so often, in 2005 they solved most of them, in 2008 I haven't seen an occurance where the analyzer got it wrong...).

    The lack of index in the address table is indeed fairly illogical here, but for such a simple query, most RDBMS will be able to do it fine anyway, -especially- with table statistics. In this case, my pragmatic self would never expect it to be fast, but in most RDBMS, it will still be zippy. The only ones I've personally tried that will choke (even with gigs of data) are MySQL and PervasiveSQL (Pervasive makes MySQL look like the holy grail, thats for sure). I've had douzens of databases with up to 50-100 gigs of data (though it was spread out over at least 75-100 tables, sometimes up to a thousand) with no indexes aside for the primary keys and the systems were fast, on MSSQL, Oracle and Postgres (not saying indexes wouldn't have helped a ton, but it wasn't my decision to take), so its a bit of a culture shock to many when you have to spell out your intent to the database that much.

  32. Re:MySQL join performance deficiency, 2 orders of by Anonymous Coward · · Score: 0

    please do.

  33. innodb != fast by Anonymous Coward · · Score: 2, Interesting

    Sure, innoDB gives you transactions, but at the cost of a lot of MySQL's vaunted speed; half of the reason it took so much of the early open source DB business, lo those many years ago (the other being ease of app development.)

    I'm a database rube, but even I've left MySQL for PostgreSQL. Try PostgreSQL, just try it. This isn't your old 7.3 postgres anymore, no siree. ACID all the way, kicks InnoDB's butt and is probably faster than MyISAM most of the time for most of your stuff.

    8.4 is nearing completion and it's going to be fabulous. Try it.

    1. Re:innodb != fast by carlzum · · Score: 1

      I'm not defending MySQL's performance or stability, I just wanted to point out that with InnoDB it's ACID compliant. I use Oracle and postgreSQL for all of my "enterprise" applications, though mostly because PL/SQL ports to postgreSQL pretty well. We've been on 8.0 for a few years now and I'm very happy with it. The only use I have for Oracle now is the data warehouse (tied to Oracle Warehouse Builder) and Oracle applications (Financials, third party apps).

  34. Re:Uhm by daeg · · Score: 2, Interesting

    The problem is, MySQL hasn't had a stable, crash-free release in MANY years. The version you think is stable is only stable with your data set and queries.

  35. You're a genius by multipartmixed · · Score: 1

    Finally, somebody who can explain when the MySQL binary package installer is broken on a bone-stock Solaris 10 sparc machine.

    And, yes, it's totally broken, and yes, I reported it... last year. It simply does not, and CANNOT work unless you chmod a directory in /var/tmp from another window halfway through running.

    My God People.

    --

    Do daemons dream of electric sleep()?
    1. Re:You're a genius by g1zmo · · Score: 1

      I've never had a problem installing MySQL from the installation CD/DVD on Solaris 10.

      --
      I have found there are just two ways to go.
      It all comes down to livin' fast or dyin' slow.
      -REK, Jr.
    2. Re:You're a genius by multipartmixed · · Score: 1

      Last I checked, they only shipped mysql4 (note -- it's been a LONG time since I've checked).

      I use the distribution on mysql's web site. And it is truly broken.

      mysql-5.0.51s-solaris-sparc.tar.gz was the one I reported the bug on
      mysql-5.1.24-rc-solaris10-sparc.tar.gz was the most recent one I tried.

      --

      Do daemons dream of electric sleep()?
  36. Does anyone ever wonder what.... by QuietLagoon · · Score: 2, Interesting
    ... the Microsoft developers would say if they were allowed to?

    .
    Does anyone remember those Windows 2000 source code comments that leaked a few years back?

    We should not punish Open Source for being Open Source. We are a community. OK, more like a family at Thanksgiving, bickering and such.

    1. Re:Does anyone ever wonder what.... by jadavis · · Score: 2, Insightful

      We should not punish Open Source for being Open Source.

      But we should criticize it when they unleash bugs onto an unsuspecting public by mislabeling it "GA".

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
  37. Re:Uhm by woot+account · · Score: 1

    I was wondering why that joke didn't make any sense.

  38. Actually, you're wrong. by kbrasee · · Score: 1

    A text file makes a better database than MySQL.

    A text file does not make a better database than MySQL. No queries. No transactions. No way.

    1. Re:Actually, you're wrong. by Shados · · Score: 1

      You most definately can run queries on text files, as various implementations allow it (for example, there's an oledb provider that can do it, some ODBC interfaces, etc). And if you're creative, you could use some distributed transaction system to fake transactions (though I'll admit thats pushing it). Then again, for a large part of its life, MySQL didn't have transactions, no? Good thing they fixed that.

  39. Re:Uhm by LurkerXXX · · Score: 2, Informative

    Bzzzt. It exports to Oracle just fine by default, thanks for playing.

  40. Re:Uhm by jaxtherat · · Score: 1

    Don't worry, it still doesn't. I'm just trying to rationalise the EPIC FAIL of a joke to stop my brain from exploding :)

    --
    http://www.zombieapocalypse.tv/
  41. Re:MySQL join performance deficiency, 2 orders of by Anonymous Coward · · Score: 0

    the address table is ~2000 rows, ~10 bytes per row. Unless it has a clustered index (google tells me Innodb uses clustered indexes, MyIsam doesn't) the index should be ignored in favor of in memory sorting.Storing the data in separate xml files, loading, parsing, and writing code to do the joining is probably faster than mysql.

  42. Re:MySQL join performance deficiency, 2 orders of by tabrisnet · · Score: 2, Informative

    Having experience with this problem, I can tell you that the problem is that MySQL's implementation of b-tree indices doesn't work well for ranges (specifically, it can only eliminate rows on one side of the inequality). The solution is to use rtree indices (GIS functions, 'SPATIAL INDEX').

    I didn't come up with the technique, but I can't find the webpage where I found it. I did end up using it for a geolocation system though.

  43. Re:MySQL join performance deficiency, 2 orders of by James_G · · Score: 2, Informative

    I'd suggest looking into the polygon type. This article may be of some use.

    The basic idea is that you create a polygon column and create an entry that corresponds to the start/end points for each row in your table, then you can run a query like this:

    SELECT * FROM your_table WHERE MBRContains(polyfield, POINTFROMWKB(POINT(INET_ATON('1.2.3.4'), 0)));

    As a point of reference, the above query runs in my local DB here in 0.02 seconds for any IP I can throw at it.

    HTH.

  44. Re:MySQL join performance deficiency, 2 orders of by nluv4hs · · Score: 2

    Thank you for this interesting suggestion. I want it to work but I tried what you suggest and I don't see any difference in MySQL's query plan. I created exactly the same tables, except all columns of type int(10) unsigned converted to binary(4). The query plan is identical to the original.

  45. Re:Uhm by sleeponthemic · · Score: 1

    Ahh, but is that unacceptable use of "infamous"?. If "random on the street" is your gauge, very little could be labeled such. Personally, I think your analogy is overstating it, rather than the summary. Ask a person using Mysql for production code about this issue. That is the gauge of infamy in this particular case.

    --
    I record my sleeptalking
  46. Re:MySQL join performance deficiency, 2 orders of by Shados · · Score: 1

    the address table is ~2000 rows, ~10 bytes per row. Unless it has a clustered index (google tells me Innodb uses clustered indexes, MyIsam doesn't) the index should be ignored in favor of in memory sorting.Storing the data in separate xml files, loading, parsing, and writing code to do the joining is probably faster than mysql.

    I take it you're nluv4hs? In that case, if its only 2000 rows, this whole thing should be instant even without index indeed (on an average RDBMS), so this is quite the funny situation (though I'm not surprised).

  47. Re:MySQL join performance deficiency, 2 orders of by nluv4hs · · Score: 1

    No GP wasn't me. MySQL 5.0.45 takes 10 mins 45 seconds on 2124 rows (vs. 0 mins 1.3 seconds for PostgreSQL 8.1.11). Slow enough? Also GP misstated: an int(10) unsigned isn't 10 bytes wide, it's 4 bytes wide.

  48. Re:MySQL join performance deficiency, 2 orders of by Shados · · Score: 1

    Ahh ok, my mistake. 10 mins and 45 seconds on 2124 rows? Wow... ok, I take my back previous comments stating PervasiveSQL was worse. I had similar queries (with a few orders of magnitude more rows) on there and I was bitching that it took over 2 minutes, thinking it was insane.

    10 minutes and 45 seconds? What is that thing doing? Loading Crysis as part of the query analysis process?

  49. Re:MySQL join performance deficiency, 2 orders of by nluv4hs · · Score: 1

    The whole thing:
    select range.id_country from address join range on address.address between range.begin_num and range.end_num

  50. Re:MySQL join performance deficiency, 2 orders of by Shados · · Score: 1

    Yeah, I've seen it... I was mostly just joking. Its such a simple query. I noticed one of the other poster showed a query that actually worked with some changes, but it was far from being a standard query, thats for sure.

  51. Re:turd post by Anonymous Coward · · Score: 0

    It's spelled "aristocats". Yeah, for sure!

  52. Re:Uhm by Anonymous Coward · · Score: 0

    Nerds all over world would try to replicate it with gnuSQL, hack together only half the functions and when a user messaged them with a bug or feature request scream at them "Doesn't happen on my computer, its open source fix it yourself!"

  53. Re:MySQL join performance deficiency, 2 orders of by kestasjk · · Score: 1

    That's silly; IPs are 32 bit numbers, and MySQL has functions INET_NTOA and INET_ATON specifically to allow IPs to be easily stored as integers.

    Looking at his query I'm not really sure what he's trying to do, but it's a full join without join clause or an index on one of the tables which throws up a few red flags. Whatever the guy was trying to do can probably be done in a much better way.

    If MySQL can't do inefficient queries efficiently I don't care. It does efficient queries like the ones that run my site (and this one, and google) quick enough.

    Not a fanboy, can't comment on 5.1, but "someone optimize my query" isn't a good database criticism.

    --
    // MD_Update(&m,buf,j);
  54. Re:Uhm by Anonymous Coward · · Score: 0

    We just use binary files in a number of critical aspects of our company, we don't need full data integrity, just pure speed.

    Our homemade "database" is ten thousand times faster than MySQL's MyISAM db engine.

  55. Re:MySQL join performance deficiency, 2 orders of by Anonymous Coward · · Score: 0

    I would love to see that query!

    And please post something more advanced than 10000 inserts

  56. Giving away GPL rights... by GNUPublicLicense · · Score: 1

    What I really don't understand with Sun is why they would not want to "play by the rules" by forcing the contributors to give them their GPL rights... If they were a fondation like the FSF, right, no pb... but since they are a big company with not a such good reputation, it would be more reassuring to let the contributors keep their rights, like the Linux spirit and near 100% of the other GPL projects.

    1. Re:Giving away GPL rights... by petermgreen · · Score: 1

      Isn't it obvious? mysql (the company) sells licenses to use mysql (the software) without having to follow the GPL. Afaict this is thier main revenue stream. To be able to keep doing this they need to make all contributors sign an agreement giving them the right to do this with the contributed code.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    2. Re:Giving away GPL rights... by GNUPublicLicense · · Score: 1

      It's very dangerous, since the temptation is great to make the proprietary fork optimal and better than the open source version (cf darwin/macos, LZO). The GPL can protect against this only if contributors do not let go their rights and don't let happen proprietary forks.

  57. Naming convention? by Upphew · · Score: 1

    Yeah, tell us why Finns name their programs that way?
    Linus - Linux
    My - MySQL
    http://en.wikipedia.org/wiki/Michael_Widenius and http://en.wikipedia.org/wiki/Linus_Torvalds

  58. Not a Problem by Fujisawa+Sensei · · Score: 1

    I fail to see the problem.

    MySQL 5.1 isn't upto snuff, just ditch it entirely and just use Postgre.

    --
    If someone is passing you on the right, you are an asshole for driving in the wrong lane.
  59. Re:MySQL join performance deficiency, 2 orders of by Anonymous Coward · · Score: 1, Interesting

    The query is stripped down to the bare essentials, but I'd guess he's trying to track what countries his web visitors are from. The table in question (address) has ~2000 rows, each row with 1 32-bit number. That works out to 3-4 pages. At that size, using an index is detrimental to performance. Maybe it doesn't affect you, or most MySQL users, but MySQL's planner/optimizer sucks when you get beyond sql 101.

  60. Re:MySQL join performance deficiency, 2 orders of by MikeBabcock · · Score: 1

    How about this one? The queries ACID makes (no relation to ACID of DB studies) against the database data generated by Snort are significantly faster in MySQL than Postgresql with certain operations.

    PS, that's really old data but I knew where to find it quickly :-).

    --
    - Michael T. Babcock (Yes, I blog)
  61. Re:Uhm by Anonymous Coward · · Score: 0

    Don't forget the iSQL Shuffle. It's smaller and costs less, but you have to load in all your SQL queries at the beginning, and it runs them in a random order.

  62. Further confirms what we all know: by spinkham · · Score: 1

    MySQL is a decent row store.
    PostgreSQL is a robust relational database.

    Please use and evaluate accordingly.

    I'm actually as excited about Drizzle as I am hard on MySQL. MySQL has tried to grow into something it just wasn't designed for. Drizzle is a project to return MySQL to its strengths of being a simple, fast row store with SQL interface. I have no problem with that, I just object to MySQL masquerading as an "enterprise class" RDBMS.

    --
    Blessed are the pessimists, for they have made backups.
  63. Re:MySQL join performance deficiency, 2 orders of by suggsjc · · Score: 1

    Okay... so what's your query?

    <?php
    $sql = "select 1 from mytable";
    $result = mysql_query($sql);
    ?>

    Postgres is horrible it can't even handle this extremely basic query!

    --
    When I have a kid, I want to put him in one of those strollers for twins and then run around the mall looking frantic.
  64. Re:Uhm by carlzum · · Score: 1

    Really, Transact SQL, identity columns, and bit data types export to Oracle? I've always had to translate them to PL/SQL, sequences, and numbers. Yay, I win.

  65. Re:Donald Rumsfeld by Anonymous Coward · · Score: 0

    Fuck off is this flamebait, just because I saw the 'known knowns and unknown knowns' joke before anyone else.

  66. Re:MySQL join performance deficiency, 2 orders of by Just+Some+Guy · · Score: 1

    PS, that's really old data but I knew where to find it quickly :-).

    MySQL doesn't support transactions. I know that's a really old complaint but I knew where to find it quickly :-).

    --
    Dewey, what part of this looks like authorities should be involved?
  67. Re:MySQL join performance deficiency, 2 orders of by kestasjk · · Score: 1

    Instead of testing whether 2000 random IPs are in a given range, then moving onto the next range, why not order the IPs using an index and use an outer join to output their country (because they'll already be sorted into ranges).

    If you want to sort a bunch of people into different height ranges you usually order them all first and then split them, instead of measuring the height of each person.

    --
    // MD_Update(&m,buf,j);
  68. Probably Not Tuned by Slashdot+Parent · · Score: 1

    The default tuning parameters for InnoDB are completely braindead. I don't know why they can't do a better job with that. For instance, the default InnoDB buffer pool size is 8MB. This is woefully inadequate for any nontrivial database operation, because that means your database will only allowed to be able to use 8MB of RAM for data operations.

    Have you experienced performance issues with a properly-tuned InnoDB?

    --
    They don't grade fathers, but if your daughter's a stripper, you fucked up. --Chris Rock
  69. Re:MySQL join performance deficiency, 2 orders of by nluv4hs · · Score: 1

    Thank you for the link and your example code, that helped a lot. I want this to work, but I don't see enough performance improvement yet. Did I do this the way you imagined? I didn't try to finish the query on the full set because it took too long. Here I ran the join on 16 rows.

    mysql> create table `geomaddress` (`address` geometry NOT NULL, SPATIAL KEY `address` (`address`)) ENGINE=MyISAM select GeomFromText( concat( 'point(', address, ' 0)' ) ) as `address` from address;
    Query OK, 2124 rows affected (0.08 sec)

    mysql> CREATE TABLE `polyrange` (`poly` geometry NOT NULL, `id_country` tinyint(3) unsigned default NULL, SPATIAL KEY `poly` (`poly`), KEY `id_country` (`id_country`) ) ENGINE=MyISAM select GeomFromText( concat( 'polygon(( ', begin_num, ' 0, ', end_num, ' 0, ', begin_num, ' 0 ))' ) ) as `poly`, id_country from range;
    Query OK, 105920 rows affected (24.07 sec)

    mysql> create table `geoma2` (`address` geometry NOT NULL, SPATIAL KEY `address` (`address`)) ENGINE=MyISAM select address from geomaddress limit 16;
    Query OK, 16 rows affected (0.00 sec)

    mysql> select r.id_country from geoma2 a join polyrange r on MBRContains(r.poly,a.address);
    16 rows in set (6.08 sec)

    According to EXPLAIN MySQL isn't using the spatial index. It doesn't matter whether I use on or where.

    mysql> explain select r.id_country from geoma2 a join polyrange r on MBRContains(r.poly,a.address)\G
    *** 1. row ***
    id: 1
    select_type: SIMPLE
    table: a
    type: ALL
    possible_keys: address
    key: NULL
    key_len: NULL
    ref: NULL
    rows: 16
    Extra:
    *** 2. row ***
    id: 1
    select_type: SIMPLE
    table: r
    type: ALL
    possible_keys: poly
    key: NULL
    key_len: NULL
    ref: NULL
    rows: 105920
    Extra: Range checked for each record (index map: 0x1)
    2 rows in set (0.00 sec)

    6.08 secs/16 = 0.38 secs/row. That would be 13 mins 22 seconds for 2124 rows. Can I do better?

  70. Re:MySQL join performance deficiency, 2 orders of by Anonymous Coward · · Score: 0

    Congratulations! your planner is better than mysql's! That's actually what the db should be doing when it performs that query. (The index is irrelevant with such a small amount of data, though).

  71. Re:MySQL join performance deficiency, 2 orders of by James_G · · Score: 1
    I'm not sure you're going about it the same way as me. Let me summarize from start to finish.. Perhaps it will help:

    The polygon is a representation of the range in dotted-quad representation of the network address. For example, 3520957440 to 3520958463 (209.221.140.0 to 209.221.143.255).

    The table definition is as follows:

    CREATE TABLE `ip_ranges` (
    `poly_ip` polygon NOT NULL,
    `range_start` int(10) unsigned NOT NULL,
    `range_end` int(10) unsigned NOT NULL,
    `location_id` int(10) unsigned NOT NULL,
    SPATIAL KEY `k_poly_ip` (`poly_ip`)
    )

    The poly_ip column is generated as follows:

    GEOMFROMWKB(POLYGON(LINESTRING(POINT(3520957440, -1), POINT(3520958463, -1), POINT(3520958463, 1), POINT(3520957440, 1), POINT(3520957440, -1))))

    Note that we're describing a rectangle here. Doing it on a line doesn't seem to work, hence the -1,1.

    If that doesn't help. Feel free to e-mail me to continue this discussion.

  72. Replicate your tables to MyISAM by Anonymous Coward · · Score: 0

    Want to search with full-text indexing? Replicate the table to MyISAM. It's a pain to configure - but when it's done you get ACID and FT search.

  73. Re:MySQL join performance deficiency, 2 orders of by Rich0 · · Score: 1

    How many records in each table? If both address and range have 2000 records then that is 4M combinations, which it might be running through (and discarding the ones that don't meet the join criteria). That isn't the smart way to do it, but I could see how it could happen.

  74. Oh great by Safety+Cap · · Score: 1
    Now you're bringing in the old "Coincidence is not Causality" chestnut again.

    Next thing you'll say something irritating like 'past performance is no indication of future behavior'.

    You guys make me sick, with your logic and stuff.

    --
    Yeah, right.
  75. Hahahah - Toy Database - Hahahahah by Safety+Cap · · Score: 1
    Oh dear. Next you'll expect them all to (re)write the date-based/math/string manipulation functions in the app layer.

    Oh, and they shouldn't forget to include the triggers in their custom DB interface. That way they'll know they got it right...until they get it wrong.

    --
    Yeah, right.
  76. Re:MySQL join performance deficiency, 2 orders of by Ant+P. · · Score: 1

    select count(*) from twobillionrows;

  77. My Experience by stimpleton · · Score: 1

    Most of my posts are marked funny, as I am usually in a fairly irreverant mood when reading posts on /.



    I have been using mysql for 5 years(Before that 3 years in Oracle), in hundreds of websites and a few intranets. Some driving huge queries. Some driving simple high volume queries. A few enormous transaction numbers in a few.

    I have never had mysql "Blow a table" once, or any other issue, the exception being failing drives.

    --

    In post Patriot Act America, the library books scan you.
  78. Re:MySQL join performance deficiency, 2 orders of by poopdeville · · Score: 1

    Anyway, shouldn't an industrial-strength RDBMS be able to interpret and optimize the simplest possible range join written as such?

    HAHA!

    --
    After all, I am strangely colored.
  79. Horsesh!t by Anonymous Coward · · Score: 0

    I'm sorry, I forgot that many developers expect their storage engine to BE their application instead of writing good code themselves.

    Shouldn't you be validating your dates or numbers or other values BEFORE sending them to your storage system? Shouldn't the database's job be to store your data in a logical fashion so its easy to find later, and then find it when you query it?

    I don't understand people who expect the database to replace the middleware of their application.

    I'm sorry, I forgot that many developers expect their storage engine to BE their application instead of writing good code themselves.

    Has nothing to do with that, and you (should) know it.

    I suppose that Oracle, Microsoft SQL Server, Sybase, IBM DB2, Informix (R.I.P.), etc. etc. have it all wrong? Not to mention PostgreSQL and now even MySQL 5.0/5.1, etc.

    The purpose of data validation in the database is to ensure that the database preserves valid data. After all, we all know that your middleware is not filled with bugs that may silently corrupt the data that is being stored....

    1. Re:Horsesh!t by MikeBabcock · · Score: 1

      I tell you what, you feel free to trust the DB layer to do that validation work, and I won't.

      We'll see who's happier in the end with the results.

      Personally, I like my database code to be intelligent and in one place where it can be debugged as a unit. That means I don't have indexing decisions being made in applications any more than I have text format codes in the database.

      --
      - Michael T. Babcock (Yes, I blog)
  80. Not Happy by Anonymous Coward · · Score: 0

    I like Open Source software because its free of the constraints of Proprietary Software. One of those constraints is software excellence. Commercial software manufacturers will only fix/debug software to the point where it becomes uneconomically viable. At that point, they stop. Open Source software developers will keep tilting at the windmill till its right. Someone somewhere will keep hammering away at it till their peeve is gone. Sun saying 'Its not just good, its good enough' is the Krusty-the-Klown(tm) commercial software mantra. Open Source users are accustomed to a much higher standard and are justifiably angry with the 'barely-barely, good-enough' effort. Sun took good software and screwed it up. I'm sticking to 5.0 (last non-Sun release) until I see something better.

  81. Re:Uhm by tgrigsby · · Score: 1

    In all fairness, I have to comment that I've been using MySQL for all of my projects for years, and I haven't had a crash yet. Because my software is database agnostic I tend to stick to simple inserts, updates, and deletes, and somewhat complex selects. But to date MySQL has been the best open source solution I've come across for flexibility, speed, and ease of use.

    --
    *** *** You're just jealous 'cause the voices talk to me... ***
  82. Re:MySQL join performance deficiency, 2 orders of by MikeBabcock · · Score: 1

    Except, you're wrong? Transaction support has been in MySQL for many years now. I actually gave a valid performance metric to the questioner.

    --
    - Michael T. Babcock (Yes, I blog)
  83. Re:MySQL join performance deficiency, 2 orders of by Just+Some+Guy · · Score: 1

    The point being that you can't use 8-year-old data to demonstrate one point any more than you can use 8-year-old data to demonstrate its opposite.

    --
    Dewey, what part of this looks like authorities should be involved?