Slashdot Mirror


MySQL 4 - Is it Stable?

Shaklee3 asks: "I have been running version 3 of MySQL on the company's website for quite a while now. We recently ran into a problem where we needed the new features of version 4 that uses the UNION clause. We are running FreeBSD 4.6-STABLE and Apache 1.3.26. I know they reccomend not using it in a production environment yet, but from what I hear it is already being used on a few major websites. Does anyone have experience with version 4, and is it stable enough to run on a high traffic site?" If you feel MySQL isn't ready for prime-time, where specifically do you feel it needs improvement?

153 of 453 comments (clear)

  1. All I want for Christmas... by Hollinger · · Score: 5, Interesting

    Is Sub-selects and foreign keys. These are probably the two biggest features I've constantly found myself needing / wanting.

    1. Re:All I want for Christmas... by PunchMonkey · · Score: 5, Interesting

      For Christmas? I want views!!! Precious views!! I need to secure certain data from the prying eyes of account managers and sales folk. So everynight I'm rebuilding these summary tables for each user! Argh!!!

      There's no such thing as row-level security.... my kingdom for views in mysql!!!

      --
      I'll have something intelligent to add one of these days...
    2. Re:All I want for Christmas... by swingkid · · Score: 2, Informative

      So use a real database: Oracle, Sybase, MSSQL, Postgres, DB2 (etc, etc) all have such features.

    3. Re:All I want for Christmas... by Libor+Vanek · · Score: 2, Offtopic

      I agree - without these features I don't call MySQL database. I'm doing some SIMPLE intranetwork groupware (mainly managing information about companies, people and contacts) and some of my SQL queries are 4 lines long and has got 3 sub-selects (I use PostgreSQL and I'm VERY happy with it).

    4. Re:All I want for Christmas... by kylant · · Score: 5, Informative

      MySQL includes the fabulous InnoDB which offers foreign keys, great performance and row-level locking.

    5. Re:All I want for Christmas... by Karora · · Score: 5, Informative
      Is Sub-selects and foreign keys. These are probably the two biggest features I've constantly found myself needing / wanting.

      Then you probably should be using PostgreSQL, which has had these features for some time. It also has UNION, functional languages, extensible types, full transaction support, SQL standard syntax, unlimited row length...

      Stick with MySQL when performance is critical and you want to do straight SELECTs from simple tables with few joins and very few updates.

      Go with PostgreSQL if you want an RDBMS that supports transactions, that scales when writers and readers both use the DB at the same time, if you want to support complex queries or if robustness, programmability and configurability are important to you.

      --

      ...heellpppp! I've been captured by little green penguins!
    6. Re:All I want for Christmas... by SpatchMonkey · · Score: 2, Offtopic

      If you need indexed tables and performance is critical then why not use this instead of mySQL? I mean, for the limited SQL syntax that is actually available in mySQL, you may as well not bother using it.

    7. Re:All I want for Christmas... by zmooc · · Score: 3, Informative

      Shameless plug: we use SapDB for all of our customers. It's GPL, stable and we're really happy with it.

      --
      0x or or snor perron?!
    8. Re:All I want for Christmas... by TardisX · · Score: 2, Insightful
      People keep saying this.

      If it's so good, why isn't it the default?

      What is the con?

      --

      Command attempted to use minibuffer while in minibuffer
    9. Re:All I want for Christmas... by rtaylor · · Score: 5, Interesting

      Regarding performance:

      Postgresql starts out slower in comparison, but the curve degrades much less when you throw more people at it.

      For ~10 simultaneous connections or less, MySQL will be faster in simple situations (simple tables, few joins, few updates / deletes). After ~10 connections Postgresql starts to shine.

      After about 200 to 300 connections Postgresql seems to be a touch faster than Oracle, but the difference in speed isn't enough to make either a choice over the other.

      Anyway, great to see a MySQL release coming up. We regularly use it for batch analysis (dedicated machine, single connection, large record sets, selects only) but are debating moving to BDBs for speed reasons.

      --
      Rod Taylor
    10. Re:All I want for Christmas... by Daniel+Dvorkin · · Score: 4, Insightful
      without these features I don't call MySQL database
      [sigh] Any method of storing data electronically is a database. MySQL is a database, Oracle is a database, PostgreSQL is a database, Access (God help me) is a database, a flat text file is a database, a bunch of random text files scattered all over your hard drive that you have to search with grep constitute a database.

      Now, if you want to argue that MySQL isn't a very good database, that's your business. (I disagree; I make my living as a MySQL DBA, and love it. But you have a right to your own opinion.) But saying that it's not a database because it doesn't have feature x is like saying that a car without cruise control isn't a car.
      --
      The correlation between ignorance of statistics and using "correlation is not causation" as an argument is close to 1.
    11. Re:All I want for Christmas... by dublin · · Score: 3, Insightful

      I want views!!! Precious views!! I need to secure certain data from the prying eyes of account managers and sales folk.

      Sounds to me like you're really trying to hammer that socket-head capscrew into place, rather than finding an appropriate Allen wrench.

      It's amazing to me how many people in the open source community continually try to force mySQL into doing jobs it's clearly not up to. This is especially puzzling, since there *are* good, modern, high-performance, high-function databases out there, things like Postgresql, Interbase,and the Sleepycat Berkeley DB (not SQL, but really fast and solid) among many others.

      For quick, dirty, and fast, without the hassles of dealing with SQL at all, there are options like NoSQL and Starbase, both of which are based on the Stream/Modifier concept of the original /rdb that allows fast, flexible database operations and allowing the use of the full power of the Unix environment. ( It's easy, leverages a zillion other existing tools, and everything you learn is directly applicable to anything else you do in a Unix environment.)

      It seems most people want SQL just because it somehow legitimizes their project as "serious", when in reality, it often just adds undesirable complexity and support cost. SQL is often unnecessary and actually undesirable, if you allow yourself to consider the possible benefits of NOT using a SQL database.

      Also, keep in mind that *any* database (and especially ones that are already very fast,like BerkeleyDB or Starbase) is lighting fast in RAM, and memory is now cheap enough to make putting the whole DB in memory a very do-able thing: A gigabyte or several of database is BIG, and easily supportable on very affordable server hardware.

      And of course, there is a reason those commercial database companies exist: They often offer capabilities that open source users may never have. I am looking right now at a new application which will be *much* faster and cheaper based on Intersystems' unique Cache database than it eould be on any of the more common big names. It's important to choose the right tool for the job. (In this case, I need lots of transactions in a very large sparsely populated database, Cache is excellent there, an order of magnitude better than Oracle or DB2, which is why Cache is the leading DB choice for electronic medical records systems, and has been for years.)

      MySQL is not the answer to every database problem. Or even most of them, truth be told. Personally, I find it to be a minimally competent, fussy, and underpowered tool. It's good for some things, but to be honest, I've always thought its appeal had more to do with being the first real open source SQL DB than with being good.

      As always, this boils down to choosing the right tool for the job. Not exactly rocket science, but something way too many people don't bother to do.

      --
      "The future's good and the present is nothing to sneeze at." - Roblimo's last ./ post
    12. Re:All I want for Christmas... by stripes · · Score: 2
      Also I heard that BerkleyDB doesn't scale for big databases. I.e. for good perfomance it must fit in RAM.

      It scales "just fine", as in there is a big performance drop off once you actually have to start touching the disk a lot, but it's not like anything can avoid that. The speed was much faster for large (but simple!) tables then Sybase was at the time I tested. And I do mean huge tables. Much much more data then fits in RAM, or one single disk. Or RAID shelf (at the time at least).

    13. Re:All I want for Christmas... by gmhowell · · Score: 2

      We have a Cache DB for our medical billing system. I don't know if it is the front end or the back, but it sucks balls. Slow and funky.

      Based on your positive impressions, perhaps I'll see if our vendor just doesn't know what they're doing. (I suspect it's whoever wrote the lousy client. It's... Well, perhaps it's not bad, but I've learned my lesson about what should and shouldn't go into software contracts.)

      --
      Jesus was all right but his disciples were thick and ordinary. -John Lennon
    14. Re:All I want for Christmas... by gmhowell · · Score: 2

      Perhaps if you substitute 'database' with 'RDBMS' it makes more sense?

      --
      Jesus was all right but his disciples were thick and ordinary. -John Lennon
    15. Re:All I want for Christmas... by Thomas+Charron · · Score: 2

      Oh yea, and that whole cash thing.. LOL

      --
      -- I'm the root of all that's evil, but you can call me cookie..
    16. Re:All I want for Christmas... by ErikZ · · Score: 2

      This is why I had my last job. Instead of giving the users access to the data, IT sets up a wall around all their resources.

      They were also in the middle of a nervous breakdown because everyone was constantly hammering them with requests. Make your data secure and back it up, and let the people you serve do their own IT.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    17. Re:All I want for Christmas... by DaveHowe · · Score: 2

      You actually have people doing SQL queries for reports? Rather than views, I would suggest a quick webpage that runs hardcoded queries for the types of reports you want these people to able to run. I would never give anyone real access to the DB if you don't want them to have access to all the data.
      Close enough to what we do - we generate predefined Crystal reports, and have a web front end that passes parameters we define into the report to select exactly what data the report provides; all the user limit validation is done in the web front end, and the upside is that they can do the queries from anywhere - even customer sites via HTTPS (no licence issues for Access, and they can grab the output as a csv, html or pdf whichever is more convenient for them)

      --
      -=DaveHowe=-
    18. Re:All I want for Christmas... by Tadghe · · Score: 4, Insightful

      "It's amazing to me how many people in the open source community continually try to force mySQL into doing jobs it's clearly not up to"

      It's amazing to me how often people who make this sort of comment miss the boat so to speak. People stick with MySQL as opposed to switching to PostgreSQL, SapDB,Firebird and the like for the same reason that VB programmers tend to stick with VB, the same reason that Susie Homeuser has stuck with Windows all these years. It has very very little to do with mySQL being "better" than the others. People stick with Mysql because it's quick to learn, easy to setup and reasonably scalable for many applications. People are staying with mySQL because they are comfortable with it, it's already installed and they know how to use it.

      Want people to switch to PostgreSQL or (Heaven forbid) *SapDB, then give Joe Admin or Derek Programmer a UI to them that works like Mysql, then make them as easy to install/backup/restore as Mysql.

      At the risk of being labled a troll, realize that mySQL will continue to be the OSS DB of choice for the hoards so long as it continues to be the quickest, easiest way to setup a (semi) RDBMS.

      *SapDB is a (IMHO) a pile of steaming speghetti code that I would not wish on my worst enemy. Try taking a look at the code (www.sapdb.org) or if you lazy, just read some of the messages on the SapDB Yahoo group (http://groups.yahoo.com/group/sapdb-general/messa ge/909) for instance.

      --
      Bugs Bunny was right.
    19. Re:All I want for Christmas... by m_ilya · · Score: 2
      MySQL does have one table handler based on BerkeleyDB. It was first table handler to support transactions.

      But it is not the only table handler MySQL has and not even the only table handler with transactions support. Moreover it is not even the fastest table handler.

      --

      --
      Ilya Martynov (http://martynov.org/)

    20. Re:All I want for Christmas... by Anonymous Coward · · Score: 2, Informative

      The current problem with InnoDB is that the size must be fixed and does not grow automatically.

      It doesn't?
      "InnoDB tables can now be set to automatically grow in size (autoextend)."
      MySQL - D.1.2 Changes in release 4.0.2 (01 July 2002)

    21. Re:All I want for Christmas... by Fjord · · Score: 2

      Just remember that everything you put in the contracts, ultimately, ends up costing you money.

      --
      -no broken link
    22. Re:All I want for Christmas... by rodgerd · · Score: 2

      Multi gigabyte DBs are common. The LA Times may be a Fortune 500 company, but I doubt that it has the requiremetn (like, say, the bank I contract to) to keep all its transactions around online for a year. The part of that I look after - and have indexed up the wazoo for MI purposes - only covers their least used channel, and is much bigger than you're used to dealing with.

    23. Re:All I want for Christmas... by alexburke · · Score: 2

      SapDB seems to be something I wouldn't wish on my worst enemy. I'm glad you see fit to unleash it on your clients...

    24. Re:All I want for Christmas... by JabberWokky · · Score: 2
      People are staying with mySQL because they are comfortable with it, it's already installed and they know how to use it.

      Which creates a second tier effect - the software my company writes is semicustom content management software. We started out supporting a long list of databases. Fairly quickly, it shrunk down to Oracle and MySQL. We have clients using Sybase, but the vast majority use Oracle or MySQL - the former because they chucked money at the problem, and the latter because they just needed something that worked and Joe Admin set it up for them and said it was Good.

      Ironically, I've seen more mucked up data problems (stuff like "the database didn't come up after the UPS fried and shut down the servers") for Oracle than MySQL. MySQL seems to be steady, stable and deliver what the people who use it need. OTOH, the people who use Oracle *really* use Oracle - often their entire company runs on it, and they have hefty databases with records going back years (medical records and the like).

      And that second tier feeds back - when people ask us what kinda of database they need, we suggest Oracle or MySQL - which, given that the numerical majority of our clients are small business, leads them to installing MySQL, which reinforces our MySQL focus.

      We're looking at producing whitebox drop-in servers early next year - at that point we may go with something else. Strictly from a financal standpoint, it ain't gonna be Oracle... but I can't totally rule out MySQL, especially now that we have server failover working. I really need to get a cluster lab set up and test the latest versions of low cost databases - failover is minimally acceptable, but good load balancing and proper replication would be ideal.

      --
      Evan (no references in this post)

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    25. Re:All I want for Christmas... by dublin · · Score: 2

      I'm not a DB expert by any means, but here's what I do know about Intersystems' Cache - it can be faster than anything else in certain real-world applications:

      I used to be Market Segment Manager for healthcare at Sun Microsystems. This is back when Sun was a "who?" in healthcare IT (outside of medical imaging, where we were dominant, but buried in OEM gear behind the name of a Seimens, GE, etc.)

      When the Ultras came out, we wanted to aggressively go after some of the spaces where we would be a good fit. One of those was electronic medical records and managed care systems, both of which tend to be large, sparsely populated databases.

      We worked closely with a clinical system vendor (which has an excellent product and has moved from a relatively unknown newcomer to one of the most favored products in the industry) and helped them face off not only Sun gear vs. IBM, HP, and DEC, but also to find the best DB to work with the hardware environment.

      According to thier own tests, this user reported the following: Oracle and DB2 were essentially neck and neck, but Oracle offered better network support, was cheaper, and was considerably easier to do business with than IBM. They were stunned to find that for thier application, Cache was THIRTY times faster than Oracle out-of-the-box. It was still nearly 10X faster even after doing "unnatural things to Oracle that you wouldn't want to live with."

      Similar results were reported a few months later by another ISV that built the first large-scale managed care enrollment system that was proven capable of scaling to millions of members.

      I'm also somewhat familiar with what was for a long time the showcase site for Intersystems: Boston Children's Hospital and the Harvard Medical Center. This system has grown along with the hospital server-by-server. In 1995-ish, the clinical system there was based on around 150 PC servers scattered throughout the facility. Intersystems Distributed Cache Protocol keeps the data on the move so it tends to reside neares its point of most frequent use automatically. I don't know of anything other DB that provides this sort of modular scalability and caching performance that's so important in the real world., although there may be something else similar.

      I'm impressed because people I know that really know this stuff are impressed, again, I make no claim to being a database guru myself.

      --
      "The future's good and the present is nothing to sneeze at." - Roblimo's last ./ post
    26. Re:All I want for Christmas... by mi · · Score: 2
      [sigh] Any method of storing data electronically is a database

      Keep sighing. It would not be a database, but a DataBase Management System -- DBMS.

      Another response to your nit-picking suggested the term RDBMS -- or Relational DBMS. Well, not every DBMS is Relational.

      --
      In Soviet Washington the swamp drains you.
  2. postgres by GigsVT · · Score: 2, Flamebait

    If you find yourself wanting more features, then ditch the toy DB and get something better like Postgresql.

    I don't understand why people like MySQL so much when postgres is just as easy to set up and deal with, and has a much more complete feature set.

    --
    I've had enough abrasive sigs. Kittens are cute and fuzzy.
    1. Re:postgres by CynicTheHedgehog · · Score: 4, Interesting

      Don't forget that PostgreSQL is faster than most people realize. I read a benchmark that showed that on some queries it's even significantly faster than Oracle. Of course, on other queries it was significantly slower, but it all comes out in the wash. What was interesting is that while MySQL was faster on a lot of queries, Oracle and PostgreSQL actually outperformed it on a couple. What I want to know is if there are any businesses out there that can load balance PostgreSQL and have a proven track record for support similar to Oracle's "Gold" level (or whatever they call it). When all is said in done that has got to be cheaper than Oracle licenses.

    2. Re:postgres by green+pizza · · Score: 2

      I don't mean to flame/troll, but I don't get it either...

      Not to mention that Postgres has been more open much longer than MySQL has been.

      I personally use Interbase, but have used both Postgres and MySQL.

    3. Re:postgres by sc00ch · · Score: 2, Informative

      Just as easy to setup? Have you tried installing postgresql on a windows box? Currently, the only solution they offer is by using Cygwin and there is no simple installation program. I eventually got it running but i would certainly not say it was as easy as mysql on a win32 platform. A lot of people i'm sure are turned away by this...

      Remember that many developers like to use windows and dont have the money to set up a seperate box for running a database.

    4. Re:postgres by technomancerX · · Score: 3, Interesting

      Basically, fulltext indexing is why I'm still using MySQL...

      --
      .technomancer
    5. Re:postgres by Phacka · · Score: 3, Insightful

      full text search:try to look in contrib/tsearch in postgres distribution

    6. Re:postgres by micromoog · · Score: 3, Interesting

      People like you are the cause of today's crappy, bloated software. There is no substitute for well-optimized code.

    7. Re:postgres by Andrewkov · · Score: 3, Funny
      Maybe so ..

      Do you use assembler for all your programming? Or have you ever created a bash script, perl script or C program? If so, why?

    8. Re:postgres by micromoog · · Score: 3, Insightful
      Point taken, but there should be a happy medium between complexity and performance. Just throwing more hardware at every performance problem leads to VERY underperforming software when you get to the macro level.

      Think about if you implemented all of your sorts using a bubble sort because they are easier, then just "threw more hardware at the problem" instead of using a better algorithm. When your app starts doing 400 sort operations/second, the hardware cost becomes prohibitive.

    9. Re:postgres by Andrewkov · · Score: 2, Insightful

      You are right, but you are taking my point to the extreme. My point was that a database admin/programmer could make his application more reliable, and do it in less time if he used a database server which supports many of the features that are missing in MySQL. Sure the MySQL version will run a tiny bit faster, but in most cases the trade off of the developers time is probably more valuable. That's why I use PosrgreSQL.

    10. Re:postgres by ergo98 · · Score: 2, Insightful

      The opposite case is very possible as well. At a prior position the organization had a problem with an onsite monitoring system (a system monitoring thousands of points and logging them constantly to a database, feeding them through HTTP, doing replication between sites, etc). Anyways, after they had spent literally hundreds of hours trying to optimize the software I offered the suggestion that perhaps they should just upgrade the CPU and add some RAM. The minimalist's foolish reply "Yeah, well I don't want to just throw more hardware at the problem". Uh huh. Instead of throwing $250 worth of hardware, we spent over $8000 in labour trying to optimize, and to the best of my knowledge the situation still exists.

    11. Re:postgres by jshowlett · · Score: 2, Insightful

      Sure, sometimes software is slow because of sloppy coding. But in many cases (like this one, perhaps), performance is due to explicit design decisions that are optimizing for quality attributes other than speed.

    12. Re:postgres by phred · · Score: 2

      Gosh. I guess Oracle was a toy for the first dozen years of existence before it had transactions.

      But I don't care. I like MySQL and Postgresql OK, neither of them works particularly well with the apps I have, so I still use R:Base which has had COMMIT/ROLLBACK since about 1991*, subselects and referential integrity since before that, it's fast and easy to work with, and doesn't have data or index corruption problems.

      And I really don't care what people think they know about R:Base.

      My only regret is being unable to talk the current owner/developer into doing a Linux port a couple years ago.

      *In 1991 Oracle was still in the multi-year process of putting out press releases about how they were going to have transactions Real Soon Now.

      --------

      --
      Bill Gates Is My Evil Twin.
    13. Re:postgres by micromoog · · Score: 2

      Spoken like a true short-sighted middle manager.

  3. Using 4 since it came out at the end of 2001 by Anonymous Coward · · Score: 5, Informative

    Running High traffic webboarding system, online stores, other various web apps running off of it and I have not had one problem related to mysql 4 not being stable.

    I think it was good enough for production the day it came out, but they just wanted to keep it in Alpha mode for a while just in case...

  4. Which DB is better!! THe world will never know by cyberlotnet · · Score: 3, Insightful

    Its the endless battle..

    Its worse then sitting in a room full of RedNecks fighting over which car is better.. Ford Or Chevy, with some silly idiot trying to throw in a Toyota once in a while..

    Rephrase for slashdot

    Its worse then sitting in a room full of SysAdmins fighting over which DB is better, Mysql Or Postgres, with some silly geek trying to throw in a Oracle once in a while..

    1. Re:Which DB is better!! THe world will never know by Phil+John · · Score: 4, Informative

      Hmm...silly geeks throwing in oracle?

      I worked on a couple of very large sites a few years ago (OK Magazine and Television-X the fantasy channels website - fantasy121.com) and the only databases which would scale to what we wanted with no problems and serious speed problems were MSSQL and Oracle...and not liking M$ stuff (security holes...monopolies yada yada yada) we chose oracle and never looked back.

      For huge sites I would heartily reccommend it...and the cross platform java admin/setup tools were a brilliant touch.

      O.k. it costs a bomb...but to a certain extent you gets what you pays for (although for free (as in beer) MySQL gives you pretty good bang for your buck).

      So what if oracle isn't open source...it's still one of the best.

      --
      I am NaN
    2. Re:Which DB is better!! THe world will never know by HiThere · · Score: 3, Interesting

      It's silly, because it costs so much, which makes it totally impractical for a large range of purposes.

      It's silly, because we hires a team of Oracle approved contractors, and after six months they didn't even have a dialog box working. So Oracle replaced them with another bunch, and they quickly go stuck too.

      OTOH, some things only work with Oracle. If you need them, then that's what you have to use, warts and all.

      What is better depends on what you need.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    3. Re:Which DB is better!! THe world will never know by el_chicano · · Score: 2
      What's better: Red Hat, Suse, or alternative option Debian.
      Mandrake? :->
      --
      A man who wants nothing is invincible
  5. Been running it for a while now... by Phil+John · · Score: 4, Informative

    I've been following the developments very closely and have had it running fine on my development box (P3, Win2K Pro) for over a month without a reboot.

    I've also had a test site live to the world running off my broadband connection, so I could test stuff from work etc. and I haven't found any problems yet.

    However I don't know how it would scale to a large site (the test site was 34 tables and only around 50k records in total).

    I think a lot of the "don't use this on a live site" stuff is just to cover their own asses in case something goes wrong.

    --
    I am NaN
    1. Re:Been running it for a while now... by Phil+John · · Score: 2, Funny

      Yes I am! who is this?

      --
      I am NaN
  6. Pretty stable for me.... by wenzi · · Score: 3, Informative

    I have been using it for quite some time on a large active database. I have not had any problems with corruption, and it has been solid as a rock so far.

    Why use mysql instead of Postgres ? Speed....

    --
    -- I doubt, therefore I might be.
  7. MySQL supporters need to learn SQL by rsmah · · Score: 4, Informative
    MySQL's popularity can be traced back to the popularity of mSQL and MySQL's compatability with it. It's widespread use, however, is like the spread of Microsoft Windows or Visual Basic. Some people *believe* that MySQL is somehow "easier" or "faster", but that's just not the case.

    If you are a MySQL user and don't understand why people who know databases don't like it, you simply have to consider MySQL's lack of common SQL DBMS features such as:

    • Transactions
    • Subselects
    • Views
    • Triggers
    • Constraints
    • Foreign Keys
    • Etc, etc, etc.
    You may not understand why such features are important, but that doesn't mean that having them available for use when you do finally learn about them isn't important. A DBMS without such common features is like driving a car without seat belts and air bags. You may get where you want to go, but woe to you if you run into any trouble along the way.

    BTW, yes, I know that Mysql supports foreign keys and transactions if you use innondb tables. But the point of using a SQL database is that you shouldn't have to worry about the underlying data representation.

    Cheers,
    Rob

    1. Re:MySQL supporters need to learn SQL by EastCoastSurfer · · Score: 2

      I totally agree. Using mysql is going to be an exercise in frustration for anyone who has used a real rdbms before. Some things like foreign keys you can do without in your careful (just hope no one else on your team executes a query that orphans records in another table). Things like subselects and views on the other hand are requirements(MSSQL has a really cool thing called partitioned views...awesome for storing dated data). It totally baffles me that mysql didn't even have the UNION clause until ver. 4. Can you use SQL 92 syntax yet and do your joins in the FROM clause or do you still have to do them in the WHERE clause?

    2. Re:MySQL supporters need to learn SQL by Quietust · · Score: 2
      Can you ... do your joins in the FROM clause or do you still have to do them in the WHERE clause?
      You mean like this?

      SELECT * FROM table1 t1 LEFT JOIN table2 t2 USING (common_column) WHERE t1.column1=7

      If so, yes. You don't even need MySQL 4; 3.23 can do it just fine (though it may be missing a few variations).
      --
      * Q
      P.S. If you don't get this note, let me know and I'll write you another.
    3. Re:MySQL supporters need to learn SQL by LatJoor · · Score: 5, Insightful

      Everyone knows that MySQL is not a good choice for heavy lifting, it's much better for lightweight applications where you have a simple database with lots of SELECTs and not much updating. Get used to it. Why must you force it to fit a different mold as well? The reason many of those features were left out is because they resulted in design decisions that slowed the thing down. And yes, MySQL is faster than any other database, except perhaps Oracle when it's finely tuned, but if you have the time and expertise and money for that, chances are MySQL wasn't the database you wanted anyway.

      I've used PostgreSQL, a highly SQL compliant DB, and I've used MySQL. I moved to PGSQL because it was a "real RDBMS." After a while, I ended up going back to MySQL because I wasn't using any of the features that made PostgreSQL more desirable. I was writing a fairly simple WWW application.

      Many people don't care about setting up a fancy RDBMS, they just want a few tables that they can easily commit to and select from, like a glorified Berkely DB. What's wrong with that?

    4. Re:MySQL supporters need to learn SQL by Anonymous Coward · · Score: 5, Insightful

      I am more than a little experienced with "real" RDBMS packages (using MS SQL, DB/2 and Oracle professionally and occasionally personally), and I *believe* that MySQL is somehow "faster".

      Why? Because, in general, _it is_. Easier? Easier than Oracle and perhaps Postgres. Toss in some of the third party apps (MySqlFront comes immediately to mind), and it does get quite a lot "easier".

      If you are someone who "knows databases", and think you "shouldn't have to worry about the underlying data representation", you are not, in fact, someone who "knows databases". From a MS SQL standpoint: if you have not already married your copy of Delaney's Inside SQL Server (HEAVY on the "underlying data representation"), you do not, in fact, _know_ that RDBMS.

      It is such a hugely important area of knowledge when developing (and more particularly, designing) against a particular RDBMS that I am just shy of saying that statement paints you as an idiot.

      Views: They're coming. I hate waiting for it, but I can wait.

      Triggers: Showing up with Stored Procs? Who knows. Keep your business logic in the middle tier where it belongs and you invalidate 99% of the reasons triggers are used. (Yes, I know there are exceptions.)

      Constraints: Business Logic. Middle Tier.

      Stored Procedures (oh wait, this wasn't on your list!) This is annoying mostly to people who don't implement a robust middle tier. But it's coming, too.

      ANSI compliance: Far more annoying than any of these other things are the few areas where they still have stupid custom functions rather than simply implementing what the standards say.

      But, frankly, the situations where the lack of any of these features are lethal to a project are few and far between. (Lack of views and stored procedures for a DB-centric implementation of row-level security, something very few people actually do. Lack of triggers for building complete audit trails that direct DB users cannot sidestep... something else very few actually do...)

      Why do I, someone who "knows databases", use and _deploy professionally and commercially_ MySQL?

      Because it's fast, stable, and they [seem] to care a whole hell of a lot more about implementing a feature in a manner which is fast and stable rather than implementing it ASAP just so they can add a few marks to their report card.

      I have run into two, count 'em, two, areas where MySQL's "lack of features" posed a problem for me. Because I am a _firm believer_ in not tring to make the database do things it is not intended to do, I moved those two things into the very solid middle tier and the problem was solved.

      I despised MySQL until this past year or so. It was fairly obviously slanted towards driving websites rather than being a serious RDBMS.

      That has changed, is continuing to change and, by all accounts, will continue changing with every release.

      It is a pity that some people who "know databases" cannot change their narrow tunnel vision as well.

    5. Re:MySQL supporters need to learn SQL by cduffy · · Score: 2, Insightful

      I've used PostgreSQL, a highly SQL compliant DB, and I've used MySQL. I moved to PGSQL because it was a "real RDBMS." After a while, I ended up going back to MySQL because I wasn't using any of the features that made PostgreSQL more desirable. I was writing a fairly simple WWW application.

      Mind if I ask what training (preferably formal education including theory as well as practice) you've had in doing database work?

      Once you've learned to properly use the fancier features, it's hard to do without them. Otherwise you end up with more error states (sometimes meaning the app going down in the middle of the business day for no apparent reason -- I've seen this happen In Real Life due to relational integrity failures the database should have prevented), reduced speed (because of calculations that could have been done by the database itself via stored procedures are being done by the client) and the need to make assertions which should be enforced by the underlying data storage layer. If all you want or need is a glorified Berkely DB, that's fine -- but stay away from anything mission-critical.

      The thing I'm really worried about here is the "if all you have is a hammer" syndrome. All too many folks who know how to use simple databases but not how to take advantage of the "fancier" features all too frequently decide that those features aren't needed in places where they really are vitally important, resulting in Bad Things happening. The blanked warnings aren't because MySQL can't meet your needs when all you need is a prettied-up db3; they're there because if you trust it to something mission critical, you can be putting not only yourself but whoever inherits maintaining and firefighting your system through hell.

    6. Re:MySQL supporters need to learn SQL by EastCoastSurfer · · Score: 2

      Correct, or some variation there of:

      SELECT *
      FROM tbl1 JOIN tbl2 ON tbl1.a = tbl2.a
      WHERE tbl1.b = 1

      Slightly OT, you know something that really bugs about rdbms in general? It's that their query processors still aren't as good as they should be. Now if we can agree that this query should return the same results as the previous query:

      SELECT *
      FROM tbl1, tbl2
      WHERE tbl1.a = tbl2.a
      AND tbl1.b = 1

      You would think that the query processor would turn these into the same internal data retrieval algorithm, but on many databases it doesn't. On one vendors database in particular one of these queries would run quickly while the other would run out of temp space. It will be nice when vendors really start to get this stuff right.

    7. Re:MySQL supporters need to learn SQL by nebby · · Score: 2, Insightful

      You don't "know databases" if you think that many of the things you listed belong in the middle tier. If you "knew databases," you'd know that it's the job of the database to perform the final check on data integrity before ANYTHING goes into the database -- the middle tier should do business logic checking as necessary, but definitely not something so low level as foreign keys. Also, what if you have many middle tiers from many different places, and what if you screw up in your middle tier? You won't actually know that the data is screwed until a real problem crops up or you notice the table mysteriously growing.

      I'd hate to see how ugly your middle tier is when it has to do like 10 DELETE statements since there is no cascading and 5 SELECTS before an INSERT to double check the fields which normally would be foreign keys. In fact, I'd bet that you probably don't do the checking in the middle tier, since that would be retarded and you just bank on the data being consistent, even if somehow your variable with the ID gets corrupted or someone else comes in and tweaks your code.

      Or, you're a troll.

      --
      --
    8. Re:MySQL supporters need to learn SQL by Plutor · · Score: 2

      Hear, hear!

      I would mod you up if I could. Because of their large feature set, giant RDBMS's like Oracle often end up doing things that belong in the middle tier. I'm glad someone with so much real knowledge was able to speak up in favor of MySQL.

    9. Re:MySQL supporters need to learn SQL by NerdSlayer · · Score: 3, Interesting

      MySQL's popularity can be traced back to the popularity of mSQL and MySQL's compatability with it. It's widespread use, however, is like the spread of Microsoft Windows or Visual Basic. Some people *believe* that MySQL is somehow "easier" or "faster", but that's just not the case.

      Mysql nay-sayers on slashdot always talk about how Postgres blows Mysql out of the water, but I've never seen any evidence of that.

      So, take the Pepsi challenge with me...

      Postgres Faster? Well, not as of a point version ago:

      http://www.mysql.com/information/benchmarks.html

      Let's not forget about the joys of Postgres and "VACUUM" that locks the table. (Okay, in newer versions it doesn't have to lock the table, but then it slows everything to a crawl on a busy server)

      Also, clearly just from reading slashdot, you would know there's far more people using Mysql than Postgres, far more "grassroots" open source type helpful people that everyone on slashdot supposedly loves.

      Finally, compare the fucking manuals and try to argue how Postgres has an easier learning curve than Mysql. When you search the postgres site it returns a bunch of poorly named html documents, for Christ's sake.

      Though I would agree that all of the SQL functions you've mentioned are useful, they aren't necessarily so for an enterprise. And honestly, not too many people in big business are using PostgresSQL. They were either duped into using SQL Server because they're MS slaves, or they use the Far Superior Oracle, and pay for Larry Elison's 20" spoke rims on his rich-dude pimp-mobile.

    10. Re:MySQL supporters need to learn SQL by NerdSlayer · · Score: 2

      Though I would agree that all of the SQL functions you've mentioned are useful, they aren't necessarily so for an enterprise.

      Someday I will learn to proofread:

      "...they aren't necessary for small, non-enterprise customers".

    11. Re:MySQL supporters need to learn SQL by Just+Some+Guy · · Score: 2, Insightful
      Constraints: Business Logic. Middle Tier.

      Would you trust data validation on your website to client-side JavaScript, or do you enforce rules on the server?

      Seriously, I think that's a valid analogy. In either case, you're trusting that client code won't stupidly or maliciously submit bad data, and that's just not reasonable practice.

      Should your middle tiers validate data? Absolutely. Should your server accept that data without its own rigorous testing? No way in hell. To be blunt, I'd fire you for that offense.

      --
      Dewey, what part of this looks like authorities should be involved?
    12. Re:MySQL supporters need to learn SQL by ErikZ · · Score: 2

      Well, I've gone though a year's worth of database design classes. I use MySQL for my website.

      (shrug) It works. I've never had ANY failures becuse my website IS that simple.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    13. Re:MySQL supporters need to learn SQL by Jason+Earl · · Score: 4, Insightful

      The so-called MySQL benchmark compares MySQL and other databases doing a whole pile of somewhat obscure database functions one at a time. If your database only has one user, and you spend a lot of time truncating tables, then MySQL is probably the correct choice. For a much more realistic benchmark try here. After looking at MySQL's benchmarks I had to conclude that either the MySQL developers are ridiculously naive about real world data loads or that they are being deliberately deceitful. No one cares how a database performs when there is one single user.

      MySQL is a fine database if your are creating an appliation that is read intensive and that doesn't need any of PostgreSQL's more advanced features.

    14. Re:MySQL supporters need to learn SQL by tshak · · Score: 2

      Mind if I ask what training (preferably formal education including theory as well as practice) you've had in doing database work?


      Well, I'm not the person you're asking, but I have to say that it doesn't take formal education or training to learn about RDBMS's, the concept of ACiD (not the drug, or the music software), or the ability to design a reliable and scalable database. Nevertheless, I agree with your overall post. Many who say that MySql has everything they need probably don't fully appreciate what an RDBMS offers. If all you are using MySql for is a guestbook for your personal website, I'd almost rather use XML.

      What's insteresting is Slashdot runs off of MySql, and although it's gotten better, this site doesn't exactly have the award for highest uptime. What I mean by uptime is the ability to post, because the site goes into "static" mode when MySql goes down, which used to happen quite often. Also, the performance of Slashdot is directly linked to a pretty decent caching system, so MySql is generally not doing a lot of work unless there are a ton of simultaneous posts.

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    15. Re:MySQL supporters need to learn SQL by Wdomburg · · Score: 2

      >If all you want or need is a glorified Berkely DB,
      >that's fine -- but stay away from anything
      >mission-critical.

      This statement doesn't really make any sense, since BerkelyDB is primarily a database toolkit, not a database server. It doesn't even implement SQL or any other quasi-relational language, just programming APIs.

      It also implies that BerkleyDB is somehow feature limited, which really isn't the case. It supports transactions with full rollback capability, replication and transparent failover, load balancing, write ahead logging and checkpointing, hot backups, etc, etc.

      It might not make sense for a general purpose database, but if you have predictable access patterns, it can seriously rock, particularly if you want to embed database features into an application.

      Matt

    16. Re:MySQL supporters need to learn SQL by Anthony+Boyd · · Score: 2
      If your database only has one user, and you spend a lot of time truncating tables, then MySQL is probably the correct choice.

      Look at the eWeek tests. MySQL is keeping pace with Oracle even when scaled to 1000 simultaneous users. Read the article.

    17. Re:MySQL supporters need to learn SQL by mosch · · Score: 2
      Actually, data validation for web applications should generally occur at all levels.

      Client-side javascript, because it's fast, friendly, easy, and generates no load on your server while being nice to the user.

      In your PHP/JSP/whatever pages, to make sure what the user is sending you is legit, after all there could be a bug in the javascript or they could turn it off or not have it supported.

      In your database itself. If usernames are supposed to be stored lower case, put a CHECK(user == LOWER(user)) or whatever. If a column is required do you make sure it's NOT NULL, or do you rely on your middleware? constraints in the database are a good thing.

      This method not only gives you quite a bit of redundancy in your data validation, but it also scales nicely so when you decide to change languages or to use an alternate language to play with the database for some application, you're not risking creating a state that's invalid for another application.

    18. Re:MySQL supporters need to learn SQL by Osty · · Score: 2, Insightful

      Everyone knows that MySQL is not a good choice for heavy lifting, it's much better for lightweight applications where you have a simple database with lots of SELECTs and not much updating. Get used to it. Why must you force it to fit a different mold as well?

      The original poster is not the one trying to make MySQL be something it's not. If "everyone" knows that MySQL is not good for "heavy lifting" (by which I assume you mean a complex data set, lots of writes, the need for strict relationship management, etc), then why does "everyone" seem to want to use it just for that? Slashdot is arguably "heavy lifting" (okay, the data set may not be very complex, but there's a lot of it, and there's a lot of writes), yet it uses MySQL. As well, about once a day or so, Slashdot has database-related problems. Coincidence? I doubt it.

      Why must you force it to fit a different mold as well? The reason many of those features were left out is because they resulted in design decisions that slowed the thing down.

      Or so the MySQL team tries to justify those decisions, right up to the point where they finally support one of those features. Then, it's suddenly a necessary feature and won't affect performance too much. If the MySQL team would just be honest and admit they didn't implement a given feature because they didn't want to, didn't know how to, didn't have time to, or a design flaw prevented them from doing so, then I wouldn't have a problem. However, they try to justify not including various features (say, transactions) by telling the developers that you can easily code around the problem in your client-side code (even insinuating that it's better to do so!). That's just wrong.

      Many people don't care about setting up a fancy RDBMS, they just want a few tables that they can easily commit to and select from, like a glorified Berkely DB. What's wrong with that?

      Absolutely nothing, but don't be naive. You know there are tons of people out there trying to use MySQL for things it wasn't designed to do (look at Slashdot as a prime example, or check out some of the past Ask Slashdot questions, or look at Freshmeat.net, etc. There are even people using MySQL for financial applications! Yikes!). The moment someone has to think about how they will get at their data without using a subselect when a subselect would be the natural way to do so, or has to code their own transaction/rollback support in their client (not such a big deal now, since at least one MySQL table type has transaction support), or has to enforce relationships in their own code because MySQL doesn't properly do foreign keys, or has to fake triggers, and so on, then it's time to ditch MySQL and go with something bigger/better.

    19. Re:MySQL supporters need to learn SQL by j3110 · · Score: 2

      Actually, PostgreSQL is a "Real ORDBMS" :)

      I've used both MySQL and PostgreSQL pretty extensively, but I want to play with one of the other five or six free and open source DBMS's. (hsqldb, firebird, and SAP to name a few)

      PostgreSQL is cool because you can make your own objects with simple C routines, or use C for embedded procedures and link to them at run time. It's actually quite usefull sometimes. Most people assume that MySQL is faster than PostgreSQL because it does less. That's really not all that true if you take advantage of the features that it has. Embedded SQL will reduce your network traffic and allow you to work with the data directly on the DBMS. This also reduces the latency between queries. Ex. to transfer money from account 1 to account 2 you would need two (4 if you include begin and commit) queries. The first query would be issued to deduct from account 1, then you would wait for the DBMS to OK the query through the network or other means, then you would send the second. With embedded procedures, you would tell the DBMS to call your procedure which would do both in one shorter command.

      Slashdot could have a procedure that takes user_id and story_id and it could look up the user's preferences with an SQL and only return the data needed (null for bodies that wouldn't show). If they run the web-sever and perl script on a seperate computer, the network traffic would be reduced by a large factor over just quering all the data and changing it in perl.

      The moral is, you can use features you don't _need_ to make PostgreSQL be faster than MySQL. Then latter, when something comes up instead of saying, "I wished I had a view/sub-select/embedded procedure" you'll get whatever you need done in less time. Don't forget that PostgreSQL has REAL embedded perl procedurs, embedded SQL, or just linking to shared libraries at runtime to access functions written in any language capable of compiling down to a .so library :) (assembler, C, C++, or anything you care to write a wrapper for)

      I guess an good analogy would be: If you only use the first three gears of a 5 speed sports car, it won't go as fast as third gear in a 3 speed family car. Just because you don't need that fourth gear doesn't mean you can't use it to your advantage. Using embeded procedures marries your project to DBMS's that support them, but it is quick and easy to port between them (all you have to do is rewrite the procedures and it will work anywhere).

      --
      Karma Clown
    20. Re:MySQL supporters need to learn SQL by Darth_Burrito · · Score: 2

      I've been using MySQL for a while now, mostly for small personal projects and what not. Now I'm starting to mess with PostgreSQL mainly because a lot of 'people' were talking about it and it has some stuff I've been missing like sub-selects.

      Everyone knows that MySQL is not a good choice for heavy lifting, it's much better for lightweight applications where you have a simple database with lots of SELECTs and not much updating.

      If all you have is a simple database without lots of selects and not much updating, then why does it matter all that much what dbms you use? Why not use the system with more features?

    21. Re:MySQL supporters need to learn SQL by Jason+Earl · · Score: 2

      Yes, I realize that the benchmark was old (both MySQL and PostgreSQL have new versions out since then), but it is still more indicative of the real MySQL vs. PostgreSQL benchmarks than the MySQL benchmarks up on mysql.com.

      And yes, I realize that the InnoDB tables have row level locking and transaction support. I never said that MySQL was bad, in fact, it is getting quite good. I just have a fundamental problem with the "benchmarketing" that the MySQL folks have been using for years. There is a world of difference between their benchmarks and how you use a database in real life.

      My question for you is have you taken a look at the newer versions of PostgreSQL and seen how they react under the types of loads you put MySQL under? My guess is that you would find that PostgreSQL also performs very well, and you don't have to put up with MySQL's shortcomings. Crashing a PostgreSQL box, for example, is quite a bit less painful.

    22. Re:MySQL supporters need to learn SQL by Wdomburg · · Score: 2

      >Well, then MySQL is just a server (aka listener)
      >to a database toolkit. It doesn't make it as a
      >database server iether.

      Any MySQL build includes: a listener, a query engine, and a backend. Just because you can change the backend doesn't make it any less of a database server.

      Matt

    23. Re:MySQL supporters need to learn SQL by Wdomburg · · Score: 2

      >Read the parent post; I use the example because >it's what he used.

      True, I hadn't caught his reference originally. But you still essentially reiterated his misunderstanding about the nature of BDB.

      >That said, though, I've seen far too much data
      >corruption and too many performance failures in
      >Berkeley DB-based apps to trust it.

      I think the reliability and performance of BDB is highly dependent on the person writing to it. Since it is decidedly low-level, there are perhaps more caveats, but this doesn't differ that much from an RDBMS implementation.

      Matt

    24. Re:MySQL supporters need to learn SQL by ErikZ · · Score: 2

      Wait a minute yourself. I'll take you seriously when you're not posting AC.

      I like it when people check back on posts that they've made and respond to me.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    25. Re:MySQL supporters need to learn SQL by j3110 · · Score: 2

      That's true in very few circumstances though. The #1 bottleneck on a system is going to be network bandwidth. The second is going to me IO. Lastly, the CPU of the server usually goes unused. If you're going to have to execute the SQL anyhow, it should be moved to the server to cut back on Network utilization. Also, sometimes, the overall CPU usage of the server can be reduced by moving multiple statements into a stored procedure on the server. Some DBMS's compile or preparse the SQL in the stored procedures, or if nothing else, you can link to a C function.

      The problem I have with stored procedures it makes your application database specific. I've never ran out of CPU before hard disk throughput, so I've been using JBoss(J2EE) to force security the way I want. Even with using a middle tier on the same computer, I can still saturate a 100Mbit connection. If it ever becomes a problem, I'll upgrade the 700mhz processor and 128M of ram to an Athlon 2000XP and 512M of ram for about 300$. If the average developer got paid 50$/h, then it would be better than spending over 6 hours of tuning performance, and it would be over 3 times faster. If you use J2EE, and you have to make it work for an impossibly large client base, you could always get a DBMS that supports replication(since it will work with all DBMS with a JDBC driver) and just throw more commodity 600$ machines at the job.

      I don't know what you are doing to use 100% of the CPU on the server for 50-100 clients, but maybe you should get a book on DBMS theory. If you normalize the database and create some indexes, you'll find that just about anything will support that many users. Well, as long as you aren't spawning processes every time a client makes a request (CGI is a very bad thing).

      --
      Karma Clown
  8. Re:innondb tables by Sulka · · Score: 2

    InnoDB tables offer nice capabilites but are horrible to maintain compared to MyISAM tables.

    For example, with InnoDB you have to statically allocate the table space and there's no tools to profile for how much space you'll need, meaning you have to keep on checking the available space constantly.

    --
    "Although it is not true that all conservatives are stupid, it is true that most stupid people are conservative."
  9. You're living in the 1970s by SpatchMonkey · · Score: 2, Insightful

    Seriously, most SQL databases have moved on past the stage mySQL is at. The features you're asking for are standard in almost every other SQL-based product available.

    I mean, it's like trying to use a calculator without an 'x^y' button. Sure, the calculator might be smaller and faster but do you really want to be hitting '*' hundreds of times when you could do '^' once?

    You really are living in database technology yesterbidecade. Relational database software has moved on a lot since then - why not take advantage of it?

  10. Release Date by n-baxley · · Score: 2

    Does anyone know when it will become the official release? My Hosting company won't upgrade until it's marked stable, understandably, but I'd love to know when that will be.

  11. This is just a rumor... by jsonmez · · Score: 5, Funny

    This is just a rumor but I heard that this one guy, well he ran MYSQL4 and his arm blew off. I mean the whole thing, I am talking fingers and hands and everything.

    1. Re:This is just a rumor... by billnad · · Score: 2, Funny

      I know exactly the story you are talking about. This friend of an old roomate of mine had that happen, as my friend tells it he was lucky to keep his other arm.

    2. Re:This is just a rumor... by Tablizer · · Score: 2

      This is just a rumor but I heard that this one guy, well he ran MYSQL4 and his arm blew off. I mean the whole thing, I am talking fingers and hands and everything.

      I busted a fingernail while paging around the review of it. Is this an early symptom of arm-bustage? I always thought it was due to that Monsanto corn I ate until I heard this.

  12. new feature? by sql*kitten · · Score: 3, Informative

    new features of version 4 that uses the UNION clause.

    As far as I know, IBM's System/R had UNION in 1974 and Oracle (back when the company was called Relational Software) had it in 1979...

    1. Re:new feature? by jabbo · · Score: 3, Interesting

      YES!!!

      THANK YOU! I was wondering how long it would be before someone noted that the challenge of UNION is akin to that of the '+' operator in Lisp...

      I run all my robust projects on PostgreSQL, and the data marts on MySQL. MySQL is just a flatfile database for people too lazy to use those :-)

      Lately I've been involved in some community projects where they're currently trapped with MySQL, thank god every reasonable piece of PHP software (PHP! you know, the 'k1dd1e language'!) is now moving towards abstraction and PostgreSQL support too.

      Subselects are another obvious lack -- I have more respect for MySQL's paying customers (eg. I believe now that they understand what MySQL is for, perhaps better even than the developers!) because that indicates to me that it is paid for as a straight data mart, NEVER as an Oracle substitute. Thank god someone sees this truth.

      --
      Remember that what's inside of you doesn't matter because nobody can see it.
    2. Re:new feature? by bellings · · Score: 2
      MySQL is just a flatfile database for people too lazy to use those :-)

      Well, of course it is just a flatfile database. It's not a transactional DB, and any comparison to a transactional DB just quickly turns into a vi vs. emacs debate. But there are a couple of improvements that MySQL adds to the flatfile database. And, for the kind of program where you would consider using a flatfile database, I think that MySQL provides a couple of nice features that anyone should consider:

      • First, the single biggest plus for MySQL over a flatfile database is that many of the useful methods have already been written for you, and you don't have to roll your own -- joins, selects, sorts, inserts, deletes, and hash indexes have all been taken care of for you already. And, those methods have been reasonably encapsulated behind a small SQL-like language that is going to be easy for just about anyone to learn.

        If ever tried to maintain a few different programs that roll their own flatfile databases, you'll quickly appreciate the encapsulation that MySQL offers. In the real world, a lot of real programmers manage to produce an ugly unholy union between their data and their algorithms. At least when I'm maintaining a program that uses MySQL I can be reasonably certain of at least one level of abstraction exists, and I'm already familiar with that abstraction.

      • Second, MySQL helps with concurrent access. Some locking has been taken care of for you. It's not always perfect locking, but if it's locking that's good enough for your application, then it's good enough for your application. Again, if you've ever had to maintain code using a flatfile database, you'll quickly discover that not all programmers are very careful with their locking.
      • Third, there's a reasonable (although limited) permissions system in place. If your filesystem doesn't have ACL's (Access Control Lists), or if you don't want to create an OS user for each DB user, you'll appreciate the MySQL permission system.
      • Fourth, MySQL is a flatfile database with a network transport layer. You can stick all the data for all of your applications in one place, and even put the data on a seperate server from your applications. If you have a fairly simple application (like Slashdot, for example) that could easily use flat files, but which would benefit from a network layer, MySQL is a great plus. Of course, if your admin is a picklehead who inexplicably decides to delete the /var partition one day, you're gonna be unhappy. But if your admin is a picklehead, you're gonna be unhappy anyhow. Putting all your data in one basket makes backups and administration quite a bit easier. It also makes it easy to write new programs that use existing data.
      In short, MySQL isn't a transactional database, and it doesn't use "real" SQL. But it does give several advantages over a plain flatfile database, and I would certainly recommend that anyone use it rather than roll their own flatfile database for their programs. If you ever expect someone else to maintain your code (or, if you ever expect to maintain more than one program yourself), you'll quickly appreciate what MySQL does offer. Of course, if you need a transactional database, or true SQL support, you'll quickly curse what MySQL doesn't offer. Know your application, and you'll be fine.
      --
      Slashdot is jumping the shark. I'm just driving the boat.
  13. Re:innondb tables by EastCoastSurfer · · Score: 2

    Mysql needs to be careful with the features it adds. It holds a niche market on web sites that need a fast primarily read only db right now. When they start adding features like stored procs, views, etc... they WILL take a performance hit. Then people will be asking themselves why not just use postgres or informix or any of the pay to play dbs since these dbs already implement all these wanted features and have been around and tested for awhile.

  14. Re:innondb tables by the_mutha · · Score: 2, Insightful

    I really don't understand why so many people get caught in this stupid discussion about what is better, MySQL or PostgreSQL.

    It seems as though people live in a 2 dimensional world, a black and white world, where you only have one answer to a question.

    MySQL has its advantages and disadvantages, just like any other RDBMS on the planet. It doesn't mean its CRAP or SUPER. It ALWAYS depends on what you are trying to do with it, the time you have on your hands to develop software that will use it, the number of records you will be holding, if you need transactions or not, if you need replication or not, if you need just SELECT speed on simple tables, or if you are developping a transaction-based e-commerce app.

    There is a reason why Oracle is so popular
    There is a reason why MySQL is so popular
    There is a reason why PostgreSQL is so popular

    My motto is: "Don't be a bigoted nerd! Always use the best tool for your specific project/job"

    In some cases MySQL will be the best, in others it will be the worst.

    In most cases people talk too much and read too little about what they are talking about.

    (p.s. this is NOT a flaimbait... just a call for an end to all the nonsense!)

  15. Hmmm.. let me think about this. by psychofox · · Score: 5, Funny
    The developers warn you that it is not ready for Production use. And you don't believe them...

    I promise not not to say I told you so.

  16. Don't use proprietary SQL features by clever · · Score: 2, Informative

    You can likely change to a different database later as long as you don't use proprietary functions. Make sure you write standard SQL.

    And before you say that what you write is SQL... You might not be. Check a few of your statements with an SQL Validator

  17. Stored Procs and Foreign Keys by Ryosen · · Score: 2, Interesting

    I've been dying to dump our M$ SqlServer base for MySql for a long time now. Once MySql (finally) integrates stored procedures (which I think is now v4.2), that will happen, but not before.

    I've heard the arguments for not needing stored procs before, but we have a application environment that is spread across multiple language and technology platforms and cannot afford the duplication in database logic.

    Of course, if any one has some better suggestions, I'd be more than happy to hear them.

    --

    Ryosen
    One man's "Troll, +1" is another man's "Insightful, +1".
    1. Re:Stored Procs and Foreign Keys by Otis_INF · · Score: 2

      If costs are an issue, look at what DB2 and Oracle will cost you. Everything comes with a price, never forget that.

      Win2k support isn't dropped next april. It's supported till 2007.

      --
      Never underestimate the relief of true separation of Religion and State.
  18. Lacks multiple result sets by nwetters · · Score: 3, Insightful

    I'd always thought MySQL was a fast, simple database until I built a Type-II JDBC driver for it.

    Because the API does not allow more than one result (MYSQL_RES structure) per connection, and the client libraries are not thread safe by default, any Java classes must be synchronized on the connection. In addition, all rows in a result must be retrieved completely using mysql_store_result rather than the more network efficient mysql_use_result.

    The JDBC specification insists (sensibly, in my opinion) that Statement objects be thread safe. The necessary synchronization and use of mysql_store_result severely limits the speed of any mutithreaded application sharing a connection, and probably discounts the speed benefits of MySQL over other free databases.

    I would guess the same problems exist with other multithreaded languages using MySQL, and developers should consider these limitations before blindly agrreing with MySQL propaganda that the database if faster than its competitors for running web applications.

  19. I (heart) MySQL by defile · · Score: 4, Informative

    MySQL's limitations are not a serious problem for me. Most database accesses in my applications are consolidated in a separate layer. It is very simple to duplicate features which may be missing from MySQL.

    The support behind MySQL is outstanding, both from the mailing list and paid MySQL support. MySQL is extremely simple to set up and can handle quite impressive loads.

    To keep score, MySQL + Innobase supports transactions (w/ row level locks and multi-versioning), foreign keys. 4.0 introduces UNION statements and a supposedly cool query cache. Pretty soon should come subqueries, stored procedures, etc.

    That said, I've not used 4.0 in a production environment. What we have right now (3.23.51-max) seems to be doing the job just fine.

  20. No! by CaptainZapp · · Score: 5, Insightful
    Being more of a Postgresql kind of guy, I really can't comment on the virtues of MySQL V4.

    Having dealt with a lot of databases in a production environment here's my take:

    You absolutely don't want to run any database which is designated "not stable" in a production environment.

    Or put it another way: If I'm your boss I won't fire you for lacking features of the database. If we decided on this database engine we work around the shortcomings. But I'll have your ass sacked in no time if you install an unstable version of the product and corrupt the database in this process.

    If that seems too harsh: You may explain to me the business reason and the risks associated and get it in writing that your management is aware of what's going on and knows of the risks.

    --
    ich bin der musikant

    mit taschenrechner in der hand

    kraftwerk

    1. Re:No! by Tony-A · · Score: 2

      That's why you'll gladly pay real money for software that hackers have been downloading for free. Let *them* run into any remaining land-mines and booby-traps. Symbiosis can be thought of as mutual parasitism.

    2. Re:No! by budgenator · · Score: 4, Insightful

      But I'll have your ass sacked in no time if you install an unstable version of the product and corrupt the database in this process. The question revolved more arround setting up a separate DB with data from the production DB primarily for reporting. It might be profitable for him to set up a sandbox server with MySQL 4.0 and throw the queries from the live system at it. Prove it works stable at 2 or 3 times the present load, then add in the features you want and retest. The end result is he might not know if its stable for my apps or not but he'll now if its stable for his. If something does blow up, the production data is safe and he'll has documented retesting to cover his ass with. Who knows by the time he's done testing; maybe MySQL 4.0 will be declair production stable and his apps will be done and tested.

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
  21. "Survey Says" *ding* by Snowhare · · Score: 2, Interesting

    This is a summary of how many 'hits' I found for selected terms and pairs of term from 12 Dec 2001 to early July via Google's groups search when I was comparing Postgres and MySQL to see which is more trouble to maintain. You can draw your own conclusions as to their relative quality as based on their 'complaints' percentages.

    postgres 17800 100 percent
    MySQL 248000 100 percent
    Postgres crash 358 2 percent
    MySQL crash 1930 0.7 percent
    Postgres corrupt 41 0.2 percent
    MySQL corrupt 510 0.2 percent
    Postgres slow 558 2.3 percent
    MySQL slow 2830 1.1 percent
    Postgres buggy 41 0.2 percent
    MySQL buggy 297 0.1 percent
    Postgres bugs 612 3 percent
    MySQL bugs 7540 3 percent
    Postgres problem 4520 25 percent
    MySQL problem 42200 17 percent
    Postgres hung 46 0.3 percent
    MySQL hung 222 0.1 percent
    Postgres happy 328 1.8 percent
    MySQL happy 1810 0.7 percent

    --
    Benjamin Franz

    Lameness filter encountered. Discussion aborted!
    Reason: Please use less 'lame' filters.

    1. Re:"Survey Says" *ding* by electroniceric · · Score: 2

      I'm not sure I put much stock in this method. I'll bet if you search for MS Access and any of those words, you'd find 10 to 1000 times the number of pages - because there are soooo many Access users stumbling for help out there. I'd suggest the same thing is true for MySQL, on a more limited scale. Very, very few of these users will ever acquire the depth knowledge you'd need to make a serious assessment of the relative merits of the databases.

  22. Performance by ghum · · Score: 5, Informative

    Stick with MySQL when performance is critical and you want to do straight SELECTs from simple tables with few joins and very few updates

    "Postgresql is slow" is a very popular myth and urban legend.

    It even was a true myth - with older versions of Postgresql. Since 7.1.3 big improvements in the query-optimizer gave Postgresql big speed improvements - without stripping any of it's features.

    7.2.1 is lightning fast.


    Postgresql Tips for today: Do check out
    • the COMMENT on table.column command
    • the \d+ extended information display
    • the CASE WHEN ... THEN .. ELSE.. ENDIF construct
    1. Re:Performance by gazbo · · Score: 2, Informative
      Postgres commands:

      Tables in database: \dt
      Fields+types in table: \d [tablename]

      Nuff said.

      PS. wtf if the third line indented by one char?

    2. Re:Performance by Wolfier · · Score: 2

      Good tips. How about stored procedure searches that returns rows without jumping thru hoops and reselect with the OID's?

    3. Re:Performance by AndyElf · · Score: 2
      * the CASE WHEN ... THEN .. ELSE.. ENDIF construct
      Should it not be CASE WHEN ... THEN ... ELSE ... END?
      --

      --AP
    4. Re:Performance by Reality+Master+101 · · Score: 2

      "Postgresql is slow" is a very popular myth and urban legend. [...] 7.2.1 is lightning fast.

      PostgreSQL is pretty good, but there are a couple of "gotchas"...

      1) You MUST "vacuum" your database and generate statistics, or the optimizer's decisions will suck in many cases. I really hope they make this sort of thing automatic in the future.

      2) Any error voids an entire transaction. This really SUCKS. This means you can't try an insert, and then do an update if the insert fails with a duplicate key violation. This is the "normal" way to do a no-race-condition "insert the row if it doesn't exist, otherwise update it". I believe MySQL has an atomic operation for this.

      3) Using an "IN" clause with a sub-select causes a brute-force join without indexes. In other words,

      select * from table1 where id in (select id from table2 where code = 'BLAP') -- horribly slow, and won't use any indexes
      select * from table1 where id in (1, 2, 3) -- whereas this is really fast.

      There's a note on the postgresql web site that they're going to fix it (someday).

      Don't get me wrong, I use PostgreSQL every day and like it a lot, but it's far from perfect.

      --
      Sometimes it's best to just let stupid people be stupid.
    5. Re:Performance by Fjord · · Score: 3, Informative

      Other people have mentioned \dt , but I wanted to say you should try out DB visualizer. It's like TOAD without the wizards, but works for any JDBC database (even cloudscape). Very cool tool and best of all, free (as in beer, maybe as in speech too)

      --
      -no broken link
    6. Re:Performance by Reality+Master+101 · · Score: 2

      You have to reoptimize indices in Oracle either.

      Sorry, but Oracle is WAY better about making decisions automatically, not to mention reclaiming space.

      Wrong. It's good as it keeps your data consistent.

      Sorry again, but you're wrong. Even the PostgreSQL developers know this is brain-damaged (read the developer logs). Reread what I said -- I think you didn't understand what I was talking about. This has nothing to do with data integrity. In any case, it's MY decision when I decide to do a rollback, not the databases's.

      IN is not perfect in Oracle either. Try to use outer join instead.

      Unless they have broken it recently, Oracle will use an index in my example. And, yes, in this simple example, an outer join might work, but in many complex cases a sub-select is what I need, and I don't need apologists just telling me "well, don't do that". If they're going to support sub-selects, then support them right.

      --
      Sometimes it's best to just let stupid people be stupid.
    7. Re:Performance by Reality+Master+101 · · Score: 2

      How did you "rewrite" your procedure? Perhaps with a function "test for keyexistence if true update else insert"?

      Unfortunately, that creates a race condition. What if someone else is doing the same thing, you both test which fails, and then you both do the insert? One of you is going to fail. Unfortunately, there just isn't a solution, except do it at the start of your transaction.

      From reading the PostgreSQL developer logs, this is really a huge pain to fix. Apparently it's a very old structural problem inherited from the original project, and relates to how errors are handled at a low level.

      --
      Sometimes it's best to just let stupid people be stupid.
    8. Re:Performance by Reality+Master+101 · · Score: 2

      Unfortunately, there just isn't a solution, except do it at the start of your transaction.

      Well, I shouldn't say that. There's no solution that doesn't require locking a row somewhere, which is the way I've had to solve it in some situations.

      --
      Sometimes it's best to just let stupid people be stupid.
  23. Isn't this a mailing list question? by Zapdos · · Score: 2

    http://www.mysql.com/documentation/lists.html

    Here you will get few real answers to your question, and allot of chatter about which db you should be using.

    1. Re:Isn't this a mailing list question? by r00tarded · · Score: 2

      actually, here you will get few real answers to your question, and a lot of chatter about which db you shouldn't be using. it is slashdot after all...

  24. umm... because.... by Ender+Ryan · · Score: 2, Informative
    Because lots of times you have software that uses SQL to talk to it's database backend. Or you may need a database that talks to a number of different servers, etc. Or possibly you may need to migrate to a bigger better database in the future, like DB2 or Oracle.

    --
    Sticking feathers up your butt does not make you a chicken - Tyler Durden
    1. Re:umm... because.... by Baki · · Score: 2

      If you really already have SQL, then chances that it runs on Mysql are very small. Really, for the limited subset of SQL that Mysql supports, using something SQL based is not worth the trouble.

      In that case, better use some kind of file-based storage yourself (such as dbm files) and do it really fast and low level.

    2. Re:umm... because.... by Fjord · · Score: 2

      If the plan is to make it scalable to other DBMSs, then using MySQL is a good choice, since the other DBMSs will likely support a superset of mySQL and the rest requires only a small amount of change. Plus there is the fact that SQL is a standard, and it is easier to find people with SQL experience than find people with the willingness and to learn a proprietary system.

      That being said, these systems have their uses (I have a half baked one of my own I wrote a few years ago), and can't be discounted fully. They just aren't a clear winner over MySQL.

      --
      -no broken link
    3. Re:umm... because.... by bmajik · · Score: 2

      Hi. I'm calling BS on this. Show me the data that supports these WACs*.

      *Wild Assed Claim

      i like mySQL a whole bunch too. But unless your contention is that the majority of all databases (and more interestingly, all people coding against databases) are home users or oss-friendly isp's or the other niche places mySQL is used, i think you're full of it.

      --
      My opinions are my own, and do not necessarily represent those of my employer.
    4. Re:umm... because.... by Baki · · Score: 2

      Mysql with its lack of normal sql constructs will force you to write sql you would never ever use on real databases.

      Therefore, this argument is void. You'll have to write/design from scratch anyway (if you want to take advantage of moving to a readl DBMS).

    5. Re:umm... because.... by Baki · · Score: 2

      Yes, and there are also order of magnitude more dbm installations (namely every unix system in existance) than any other SQL RDB.

      I once needed a 'quick and dirty', mainly fast database, and used perl + tied hash files (dbm) to put my 'tables' in. Just as similar to a real RDBMS as mysql is (apart from superficial sql-like syntax), and even much more widespread in terms of installations.

  25. Suggestions by xidix · · Score: 2

    1) If you need UNION capability, you are likely starting to get into the advanced SQL area where MySQL starts to break. I would suggest checking out PostgreSQL, which will have support for a lot of these advanced features.

    2) The other alternative is to eat a little CPU and use a temporary table to get around the lack of UNION in v.3x. I've had to do this before when I was building an app using MySQL, got 90% done, and then realized I needed to do a UNION. To work around it, I did four separate queries into a temporary table, did my "union" query on the temp table, and then dropped the table. This creates the same result as UNION, but with a little more CPU overhead and a lot less elegance. But it beats either:
    a) Rewriting your app to use PostgreSQL.
    b) Taking a chance on a new and unproven version of MySQL.

  26. How/where should one learn SQl then? by Fross · · Score: 2

    I think I'm in a position a lot of people are in - I'm a back-end coder, who doesn't specialise in databases. Usually working in a team, there will be some database specialist, and I'll lead the team designing the engine that uses it, and someone else will lead the front-end. So I know some about databases, but I'm not an expert.

    I also use databases for some of my own stuff. I've found mySQL to cover everything I need to do. On a rare occasion, I have to push the boundaries a little, but that's not impossible with a little design tweaking.

    So my question is, I would like to learn more about these extra features - I know what most of them are and do, but I don't have the database structure knowledge to know what situations they should be used in, and more specifically, how to design databases to begin with to take advantage of them.

    Online resources would be preferred, I don't want to spend $50 on a book I won't use THAT much, but they will certainly be considered.

    Thanks,

    Fross

    1. Re:How/where should one learn SQl then? by FattMattP · · Score: 3, Informative

      Read SQL for Web Nerds. It's done from the perspective of someone using Oracle, but you should be able to get the idea.

      --
      Prevent email address forgery. Publish SPF records for y
  27. Is it stable? by k98sven · · Score: 2

    Laurence Olivier(nazi):Is it stable? .. Is it stable?
    Dustin Hoffman(guy):You're talking to me?
    L.O.: Is it stable?
    D.H.: What stable?
    L.O.: Is it stable?
    D.H.: I don't know what you mean. I can't tell you something's stable or not, unless I know specifically what you're talking about.
    L.O.: Is it stable?
    D.H.: Tell me what "it" is first.
    L.O.: Is it stable?
    D.H.: Yes, it's stable, it's very stable, so stable you wouldn't believe it.
    L.O.: Is it stable?
    D.H.: No, it's not stable, it's very dangerous, be careful.

  28. I've tried 4.0.2 on OpenBSD 3.1 - not recommended by the_olo · · Score: 2, Informative

    I've tried compiling MySQL version 4.0.2 on OpenBSD.

    First of all, to even get this thing compiled, you'll probably need to apply patches from the ports. See http://www.openbsd.org/cgi-bin/cvsweb/ports/databa ses/mysql/patches/ for OpenBSD ports patches.

    For example, I've needed patch-innobase_include_univ_i to compile any recent MySQL to compile on OpenBSD 3.1.
    That patch is quite funny:

    #define UNIV_INLINE __inline
    #else
    /* config.h contains the right def for 'inline' for the current compiler */
    -#if (__GNUC__ == 2)
    -#define UNIV_INLINE extern inline
    -#else
    -/* extern inline doesn't work with gcc 3.0.2 */
    +/* mysql people don't understand extern inline */
    #define UNIV_INLINE static inline

    When installing MySQL 4.0.2 I've applied all of those patches, and then configured, compiled and made make install.

    The database new MySQL daemon started up and operated fine (with previous version's data files), but mysql 4 client were unable to connect (I've got an "ERROR:" error message. Tells much, doesn't it?).

    So, to summarize, wait some more time, at least until they release a beta.

  29. Application support by jabbo · · Score: 2

    Why bother? Because numerous existing (== don't have to write/rewrite them yourself) packages can use MySQL or Postgres, but far less use Interbase.

    --
    Remember that what's inside of you doesn't matter because nobody can see it.
  30. Re:What use is the UNION statement? by Noel · · Score: 2

    Maybe I'm ignorant, but I can't see how to use a JOIN to do what I use UNION for. Maybe you can enlighten me. Here's an example:

    SELECT DISTINCT 'foo' AS src, id, ... FROM foo UNION SELECT DISTINCT 'bar' AS src, id, ... FROM bar

    JOIN combines data from multiple tables horizontally (into the same row/tuple) while UNION combines data from multiple tables horizontally (into separate rows/tuples). I need and use both, although JOIN far more frequently than UNION. In fact, I use UNION much more often when merging external data for import than I do within my main databases/applications.

    (If it makes any difference, I work primarily in Ingres and PostgreSQL)

  31. My Experience with MySQL at work... by vandan · · Score: 5, Informative

    We (I) upgraded to MySQL-4.0.1 when it came out (after a little testing at home).
    I upgraded to MySQL-4.0.2 about 2 weeks ago.
    We have about 5 databases with 10 tables in each which have between 1,000 and 100,000 records per table. We have about 30 users connected to the MySQL server from an Access 2002 front-end. I have been moving stuff from SQL Server 7 as it bogs down. MySQL-4 seems to handle multiple connections better than SQL Server - update queries that used to timeout (and crash Access) when in SQL Server now run effortlessly.

    By the way, our little MySQL beast is an AMD K6-2 500 with 256MB, and is also running an IMAP server for about 50 mailboxes. Oh - and don't forget VNC ;)

    The ONLY problems I have had have been with the MyISAM table handler with large tables & multiple users. I was getting locks and time-outs, so I upgraded them to InnoDB, and have had no other problems since.

    I have also started using transactions (which InnoDB supports). Seems to work perfectly for me. Admittedly, I'm not doing anything major, but any ... no problems for me.

    Foreign Keys are also supported by InnoDB. Works well. MySQL-4.0.2 just made foreign key constraints survive an alter table command (4.0.1 used to dump the constraint).

    What else can I say? I've been very happy with MySQL-4.0.x. Certainly no crashes or anything unexpected. And the --log-update startup option gives you a nice running backup anyway...

    I would upgrade. I think the 'alpha' versioning is being too modest.

    1. Re:My Experience with MySQL at work... by retrosteve · · Score: 3, Informative

      If you can make it through all the MySQL-haters rantings, (can somebody mod those guys down, it's off-topic!), here are my current conclusions after using mysql 4.0 in an industrial app (27 million records, about 1 million queries daily).

      1. It works good. No crashes and no more problems than the 3.23 versions.
      2. The replication still isn't there yet. If replication matters to you, wait.
      3. I agree it's not "alpha". It is no more or less buggy than the stable 3.23.51 version.

      I will be very happy when replication is working and tested and works on ALL queries and can recover from errors. Until then it's still a day of fooling around every time replication screws up.

  32. Re:Duh by nebby · · Score: 2

    Good job refuting my point:

    Statement A: MySQL should not be used for large apps because of its lack of serious features.

    Statement B: MySQL should only be used for apps which require speedy query execution with lots of data.

    Statement C: The speedy execution benefit seen in MySQL is only really seen if you have lots of data or lots of queries. If you have lots of data or lots of queries, you're not implementing a small app.

    B + C = MySQL should only be used for large apps.
    which is in conflict with A, so we conclude that it's a contradiction and you should never use MySQL.

    Now, instead of calling me a troll, explain why I'm wrong and why MySQL fanboys on Slashdot have any argument whatsoever for people to use software which causes bugs and bloated software and fails to prevent data corruption.

    --
    --
  33. Re:Postgres on windows by questionlp · · Score: 2, Interesting
    PostgreSQL is distributed under the BSD license, as stated in their FAQ. RedHat has also re-packaged PostgreSQL 7.1, included support, and called it "Red Hat Database" (more info here).

    So you should be able to build a installation package for PostgreSQL that is on par with say ActivePython or ActivePerl for Windows, and sell it (you don't have to release your code modifications) for a reasonable amount.

  34. Stable? Maybe. Worth it? Not yet. by MattRog · · Score: 3, Informative

    Let me repeat the same things I say every time:

    Why MySQL is Not Suitable for Enterprise or High-Volume Use
    or
    MySQL.com misleads you about it's capabilities

    Replication in MySQL is a joke for 'mission critical' use. As I understand it, the binary log records SQL modification statements which are executed on a master, not the data which was changed. This is involves significant assumptions beforehand, such that the master and slave(s) must be 100% identical. If I perform an UPDATE on the master, the changes are not replicated, but the query. This is what I would call the 'easy way out'. Who knows what happens to the query once it is replicated out - what if it hangs halfway through? I can't roll back and be in a consistent state, I have half-completed changes which makes my database inconsistent and now I'm forced to dump-and-load. Keep track of which rows are modified, to what from what, and ensure that those transactions are replicated to my slaves. Anything less is simply useless for high availability.

    I would also be willing to bet that a significant number of installations that have transitioned to MySQL replication are doing so due to table-lock induced latency. A suitable system with a capable RDBMS could probably handle all of the load given to it and not need 'many slaves' to handle the extra traffic. They would have a single failover for high availability and that's it.

    Filesystem buffered writes. Transactional support is great - it allows me to roll-back aborted transactions. However, due to the inability to control whether or not my tables are write-buffered means that MySQL may *think* it has performed a write even though it is still in the write-cache. I can then turn off the system and voila -- corruption! Part of the fault lies in the OS who tells MySQL it was written even though it is in the cache, but I have a simple solution. Devise a way to selectively turn off buffered writes for certain tables / databases. This way if I know I have a critical table which has a lot of writes I can turn buffering off and be ASSURED that writes will be performed when asked. I suspect a lot of 1040 and other table corruptions are caused by something like this. Yes, performance will take a hit but I think it is a very acceptable trade-off for data corruption. Obviously all system tables should NOT be buffered.

    Inability to use more than one index on a table in a query -- most enterprise RDBMS' can use more than one index on a table for a query. This can easily save a table scan or the use of a single, less-efficient index. Given an example query - 'SELECT bob FROM sometable WHERE somecol = 45 and somecol2
    Clustered indexes. These basically physically sort the table based on particular columns. This allows you to ORDER BY username ASC without using anything special since the rows are already sorted on username (if you have a users table and cluster the username col). This also greatly speeds up BETWEEN clauses. And yes, to people who know a little bit of SQL but don't know as much about clustered indexes -- you can create an index with a bobcol ASC but clustering the actual data is faster and more efficient if you are grabbing data which is not on the index. For example, SELECT * FROM table ORDER BY username ASC will not be as efficient as the same query clustered on the username. If you had a sorted index on username it will probably read the index sequentially and then visit the table. That extra operation = more disk seeks = more time / cpu to execute (and it really adds up as the table size increases). However, if you are doing something like 'select username, password from user order by username' it would be better to create a sorted index on username ASC, password. That way it will read the index only and not visit the table at all.

    On-line backups. In today's internet world your site has to be 24/7. This means you cannot have significant performance problems (or even offline-ing your dB!) when you make a dump -- Sybase, etc. have done this from as far back as I can remember. Postgres can do this with an add-on which is well worth the money. As far as I know MySQL can only do this with InnoDB tables and is a for-pay feature (since it has a MVC log to use in the meantime).

    Backups to something other than CSV files. MS SQL, Sybase, Oracle, they all dump to a compressed binary file. Saves a TON of space and is MUCH FASTER to dump and load. I can dump a 12GB Sybase DB in under 20 minutes. Loading it all (from scratch) and then bringing the DB online is about the same amount of time. MySQL stupidly logs the CREATE TABLE / INSERT statements. What does this mean? That I have to wait for 4 million INSERTs to be performed when loading my table, and FURTHER I have to wait for the INDEXES to be re-created on the new data. Dump the indexes, too! (Remember that full-text indexing is just another index, so if you use that and have to load from a dump be in store for SIGNIFICANT downtime).

    Ability to specify the number of files to dump to. What happens if you have a dump which is larger than 2GB? Some linux distros cannot handle a single file of 2GB or more without recompiling the kernel. Give users a way to, within the dump statement, split the dump over two files. Not only will that help avoid the 2GB limit, but it can speed up dump/loads since I can dump to a bunch of different disks to improve throughput. Sybase has the 'STRIPE ON' clause (originally to dump to two tape drives at once but works fine on filesystem files as well) to split the dump equally over an unlimited number of files. This also impacts the fact that MySQL tables and indexes are stored in filesystem files that are also subject to a 2GB limit.

    Cleaner way to view query plans of statements. EXPLAIN ... is great and all, but the resulting table is a PAIN to read. What I want to know is simple:
    Query is using XYZ, ABC tables. Table XYZ is using index 123 which is sorted so I do not need to create a temp table to sort ASC.
    Since you have all the columns in your select statement in the index I do not have to visit the actual table - I can pull it all from the index. Because of this, I will read the index from start to finish.
    ABC is using index 23dsf which is not sorted so I must create a temp table to sort that. Also, since it is a join, I do not need to perform an index scan but a positioned search (table scan is to a WHERE clause with no index AS index scan is to an index which is not selective enough or needs to read all columns.)
    Simple, easy and pretty much even a NOVICE can see that their query is a good performer or a bad performer.
    Along with more in-depth EXPLAIN, also provide me with a way to see what the optimizer is doing with the query. In MS SQL and Sybase you have 'trace flags' which you can turn on before your query to see EXACTLY what Sybase is doing - why does it think this index is better than this other one, why is it table scanning when you think it should index sort, etc. Give me an easy way to say 'verbose on; explain xxx;'.

    Ability to delve deeply into performance of the system. If there is one job a DBA must know it's how to tell what the heck is going on when something is slow. Currently MySQL gives you meaningless info like 'slow queries'. Great, I see 200,000 of them. What queries are they? What good is it in a large application which may contain 3000 lines of SQL to tell me the raw number of queries which are slow? I want to know the EXACT SQL of the query(s) which are slow and I want to find the one taking up the most CPU time and blocking all the rest. I want to know how MySQL is managing it's data cache so I can see if I need more ram (e.g. it is swapping lots of data to/from the cache) or if I am I/O bound. Don't tell me to look at 'free' or 'top' - half the time it is wrong because you (MySQL) tell it misleading figures. I want *you* to tell me exactly what you are doing since you would know best! If you've ever seen a sp_sysmon output from Sybase ASE you'd know what I'm talking about.

    MySQL's query optimizer is PISS POOR. If I see another changelog entry like this I'm going to scream:
    Optimized queries of type: SELECT DISTINCT * from table_name ORDER by key_part1 LIMIT #
    So does that mean these queries were NOT AT ALL optimized before? It doesn't read 'FURTHER optimized'.
    "ORDER BY ... DESC can now use keys."
    Does that mean it was table scanning each time? Jebus! Hands down the query optimizer is one of the most important things in the database -- knowing how to use the database statistics and knowing when to use a merge-join vs. a hash-join etc. are CRITIAL to database performance.

    Of course, the usuals: integrated row (or in the least page) locking, full support of subqueries, stored procedures, views, triggers, referential integrity, transactions, etc. etc. etc.'

    PostGRES and virtually 100% of 'for pay' RDBMs have this. There simply is no reason to use MySQL for anything sufficiently non-trivial.

    --

    Thanks,
    --
    Matt
  35. Speed? by Srin+Tuar · · Score: 3, Funny

    Why use mysql instead of Postgres ? Speed....

    Ah, I see, you have the unusual requirement that your database must be slow...

    :)

    1. Re:Speed? by aminorex · · Score: 2

      No, I think he meant that he's been smoking meth.

      --
      -I like my women like I like my tea: green-
  36. Re:innondb tables by leuk_he · · Score: 2

    Well one thing you forget in all your arguments in money. Mysql is more or less free. Oracle is very expensive(well, if you are the person wo has to pay for it).

    And beside the "best tool" is not always what the pointy haired boss has to say about it.

    The asker "is MYSQL 4.@ stable" askes for this. since there are alternatives that already have the features he askes for. He will be lucky if there are 1 or 2 comments (deeply burries under postgres and sapdb is better) about people that actualy use MYSQL 4.

    By the way why not program arround UNION? surey there is something in your programming language of choice to merge a couple of tables. if you need it only once or twice it might be better than a DB upgrade.

    --- IANA mysql expert

  37. woe is me! by Ender+Ryan · · Score: 2
    Woe is me, for I learned SQL using MySQL!

    INSERT INTO table SET column='value';

    syntax error SET

    MOTHER FUCKER!

    DOH! ;-)

    --
    Sticking feathers up your butt does not make you a chicken - Tyler Durden
  38. SQL language needs an overhaul by Tablizer · · Score: 2

    The UNION issue brings up yet another problem with SQL: it is too hard to self-extend. If something like this was used instead

    http://www.geocities.com/tablizer/relat2.htm

    then it would be relatively easy for somebody to add their own UNION equivalent, or whatever else is missing. It breaks queries into smaller, simpler functional-like statements instead of One-Big-Wad, like current SQL is. Although it looks like it would limit optimization because it seems sequential, the sequence is nominal only. The optimizer could ignore the sequence as long as the final result is the same.

  39. Improvements by realdpk · · Score: 2

    MySQL needs several improvements before it can be trusted with data.

    - Needs to handle memory limits better. 15 threads shouldn't be able to allocate more memory than the kernel allows (through ulimit-style limits). As it is now, MySQL hits that limit and then sits there and consumes 99.9% CPU forever. Won't die to kill 15, requires kill 9, which forces us to isamchk. Bad, bad, evil.

    - Replication should not be query based, it should be data based. As it is now, replication is nothing more than a hack. Because it is a hack, it is very easy for the slave to differ from the master, which requires shutting down the master (effectively) while you restore the slave. This can take hours. Bad, not so evil. Just bad.

    - MySQL can't tell if a database is corrupt, at least not in every case. Sometimes it'll sit there and chew CPU for hours trying to process some impossible data. This is a show-stopper, IMO. The first thing (the memory) is the typical reason for it to corrupt its databases.

    - Documentation. MySQL's online documentation is horrible. For instance, they claim that SET SQL_LOG_BIN = 0 will stop replication. But in actuality, it does nothing (and they claim it works in the version I'm using, so don't bother). This wouldn't be such a problem if they didn't change syntax so drastically between minor versions. This is very bad, but not necessarily a show-stopper.

    Some minor things:

    - Explain doesn't work right. It doesn't return the right number of rows for a query. It's seemingly random. I don't know why.

    - Insert delayed. What the hell is the point of this? It's about 10x slower when using mysqldump | mysql than straight inserts. The documentation indicates this should not be so.

    - The MySQL team seems more interested in pushing out frequent updates and calling them stable than actually testing and making sure that their server is stable. Now I'm not suggesting a 5 year beta period, but something needs to be done about this. As it is now, I'm barely comfortable with 3.23 at all. 3.22.32 was probably the last great MySQL distribution.

    I probably should have a lot more rants here, but I can't think of them now, I'm too busy trying to figure out why MySQL is so goddamned slow.

  40. MySQL vs. The Database World by Proudrooster · · Score: 3, Insightful

    Speaking as the emergency backup holographic DBA who has experience with both MySQL and other Commercial Databases particularaly Oracle, I can give you the following info.

    MySQL is small, fast and you can even use it with MS-Access with MyODBC

    The drawbacks to MySQL are limited SQL support e.g. (no subselects, no inline views, no stored procedures, and just you TRY to figure out the outerjoin syntax (geez) ), however if you are doing simple queries it's fine. If you want to do more advanced stuff and say have multiple cursors open at the same time you have to use an additional language like Perl with DBD/DBI.

    Also, MySQL does not have "read consistency", "row level locking", or the concept of a "transaction" (at least not last time I used it). If you do an insert/update it happens NOW, no need for that pesky SQL "commit".

    Again, on the plus side, generally speaking MySQL is FAST for queries! However, when you do hit a snag, it is harder to tune performance and optimize the layout of the database on the physical disks e.g. (You can't partition a table across multiple disks/filesystems and have to rely on RAID0 striping). Also, I don't think there is anything as replication so keeping a hot standby database for failover or disaster recovery can be tricky.

    The most important thing to keep in mind is this, "Use the right tool for the job". I still prefer any data I care about or, database that may affect my sleep be an Oracle database. However, replicating data from Oracle to a MySQL database, then using MySQL as the backend for query intensive web applications might make more sense e.g (Amazon-type, Slashdot-type). In this scenario, your data is tucked away securely in an Oracle database, but it feeds a bunch of lowcost, commodity beater boxes that can be quickly deployed to give lowcost scalability and more peace of mind against hacking.

    Weigh the importance of your data and "use the right tool for the job". It could be argued that the most valuable asset of a modern company is it's data.

    One of my favorite quotes which applies to this situation is: "When the only tool I have is a hammer, every job looks like a nail."

    Good Luck!

  41. it definitly depends on the usage by pfote · · Score: 2, Informative

    getting back to the topic (4.x stable or not) ..
    short answer is: if not used with replication, yes

    bout the advocacy: shure mysql has its short comings, but it heavily depends on what you do and need

    i have a mysql server that has a average of 3000-6000 queries a second, with peaks going up to bout 60000 q/s, 800-1600 connections, bout 30GB of data (which doesnt say much), lots of tables with bout 1.000.000 rows that are read only, some smaller that are frequently updated (200-300 updates/inserts/deletes per second on some tables)
    server hardware is a SUN E6500 (18cpu 400MHz, 16GB RAM), table type used is myisam except some tables with sensitive data where i need transactions, there innodb is used)

    wouldnt call it a simple at all, but its a web app

    beside others(interbase and so on) i gave postgres several tries (latest version i tested was 7.1) because of having subselects and views .. it scaled better, but the general performance was to low to even try it in production

    oracle might be a option (beside having a bunch of features more than mysql it suports clustering which i would like to have for scalability reasons) .. but its still out of question because of the price tag .. i can pay a bunch of programmers a long time for the same money, and so we tend to throw some brain on the problem instead of money

    with a different application the situation might change completely .. so your mileage may vary, but for what we do here mysql has been proven to be the best solution

    sorry for the bad english

  42. Re:Stable? Maybe. Worth it? Not yet. by peyote · · Score: 3, Informative

    Wow, a shining example of someone firmly planting their foot in their mouth on Slashdot. What a surprise. It's nice that the post was moderated up to 4 as ``Informative''... too bad most of the information was useless or wrong.

    The overarching problem in your comment was your opening statement:

    'Let me repeat the same things I say every time'

    The problem there, which is obvious to anyone remotely understanding of what active development means, is that MySQL is sort of a moving target. Your statements are erroneous is so many ways, but most of them can be boiled down to this: you are arguing against something that no longer exists. MySQL, as you attack it, is no more, and has been replaced by something far better. So let's just take some of your arguments (unlike you, I refuse to speak on those things that I *DON'T* know, so I'll skip a few with which I'm not familiar) and see how they stand up, shall we?

    Argument: Replication in MySQL is a joke for 'mission critical' use.
    Rebuttal: Somehow that fact doesn't impede Yahoo!'s extensive use of it. (See Jeremy Zawodny's presentations at the recently-held OSCON.) If the query hangs on the slave halfway through, it isn't marked on the slave as having completed. When the slave becomes available again, it notes its pointer in the transaction log and catches up automatically. Oh, and replication (at least in 4.x, possibly also in 3.23.x) is transaction-safe.

    Argument: Filesystem buffered writes.
    Rebuttal: As another poster wrote, leave the OS out of this. If you cannot properly configure your OS to not buffer writes, you probably shouldn't be running a 'mission critical' ANYTHING.

    Argument: On-line backups [are not there]
    Rebuttal: So set up a dedicated slave for backups. Turn off the slave while backups are running, it catches up when backups are done and it is brought back up. A *simple* solution to a *simple* problem. If you really feel the need to do a hot backup of your live server, you can check into using InnoDB's tool at http://www.innodb.com/hotbackup.html .

    Argument: Backups to something other than CSV files.
    Rebuttal: You mean like backing up the raw MyISAM files? Of course, that doesn't work with InnoDB databases, so you can use their hot backup tool for that as well, if this is a REAL (rather than IMAGINED) problem.

    Argument: I have to wait for 4 million INSERTs to be performed...
    Rebuttal: RTFM. No you don't.

    Argument: [No] Ability to specify the number of files to dump to
    Rebuttal: Again, is this a real or imagined problem? It's likely that whatever you are trying to do, there's a better way. Unfamiliarity with a particular tool usually results in this type of problem.

    Argument: Cleaner way to view query plans of statements
    Rebuttal: So because YOU don't like the output of EXPLAIN you're saying MySQL isn't ready for production? WTF are you talking about?! As for a more *in-depth* EXPLAIN, I agree there, and I found PostgreSQL's mechanism kind of cool. Of course, in four years of running MySQL in a production environment, I'm not sure I would have used it more than once or twice; MySQL's EXPLAIN has always been sufficient, if you actually know what you're doing.

    Argument: Ability to delve deeply into performance of the system ... Currently MySQL gives you meaningless info like 'slow queries'
    Rebuttal: RTFM. You are obviously unfamiliar with the slow queries log where MySQL gives you EXACTLY the information you are looking for. As for the data cache and whatnot, I don't know if that is actually available or not.

    Argument: MySQL's query optimizer is PISS POOR
    Rebuttal: And your evidence? Oh wait, you didn't actually provide any. You just brought up a tangential issue...

    Argument: If I see another changelog entry...
    Rebuttal: If you are that concerned, you have some good options here. (a) Pay the developers to hold your hand and explain to you what has happened. (b) Use the source and do your own friggin' diff. This is Unix; stop acting so helpless.

    Argument: [a laundry list of disinformation]
    Rebuttal: Dude, have you not even looked at MySQL since 3.21 or something? Row locking is available in InnoDB, as are transactions. Stored procedures and triggers are planned for 5.x IIRC, but so many applications DON'T need them that the MySQL folks simply haven't cared to add them. Ditto for views (which are also slated for 5.x).

  43. Postgres replaced mysql on my prod system by TheNarrator · · Score: 2, Informative
    Two years age I replaced Mysql with postgres on our production ecommerce system. This was one of the early 7.0 releases. It's much faster, and much more stable than mysql and pretty much hassle free. The one thing I found was the query structure checking in mysql is so sloppy that the port to Postgres forced me to clean a lot of the queries up. I found some ambiguities that were caught by popstgres but would introduce subtle errors in the mysql based system. That, and Postgres has transactions.

    I am convinced that the only reason people like Mysql is it has better marketing. The perfect example is those benchmarks they distribute with the software. Those are single user transactionless benchmarks!!! Single user benchmarks are not realistic. Anyway Postgres is far stabler faster product in my opinion.

  44. And why on earth would you dump SQLServer? by Otis_INF · · Score: 2

    It's worlds number 1 database system, and you want to get rid of it?

    *WHY* ?

    It has everything you want, is rocksolid and lightingfast. Ok it's expensive, but you already have it.

    --
    Never underestimate the relief of true separation of Religion and State.
  45. Re:Stable? Maybe. Worth it? Not yet. by MattRog · · Score: 2

    HI peyote, I'm glad you took the time to intelligently reply to my post. I think we're not quite on the same page in a couple places, certainly MySQL may be 'stable' (see my other post about what I consider to be 'stable') but I think the story starter was concerned with high trafficked sites which is a horse of a different color from, say, my personal site or a lightly-used corporate intranet which certainly doesn't require the types of things I illustrated in my post. I run several high-trafficked sites (upwards of 100 million imp/mo.) and those were 'gaps' in MySQL which our team isolated as ranging from 'really helpful' to 'required'.

    Rebuttal: Somehow that fact doesn't impede Yahoo!'s extensive use of it. (See Jeremy Zawodny's presentations at the recently-held OSCON.) If the query hangs on the slave halfway through, it isn't marked on the slave as having completed. When the slave becomes available again, it notes its pointer in the transaction log and catches up automatically. Oh, and replication (at least in 4.x, possibly also in 3.23.x) is transaction-safe.

    Right, and the slave goes down. So I have to manually intervene to fix it. That is unacceptable. It should do something better than simply quit and say 'oops'. Yahoo's extensive use is, as I see from MySQL.com, fairly weak:
    Size of database: 25 GB
    Average number of concurrent connections: 60
    Max number of concurrent connections: 250

    That is not worth writing home about.

    Rebuttal: As another poster wrote, leave the OS out of this. If you cannot properly configure your OS to not buffer writes, you probably shouldn't be running a 'mission critical' ANYTHING.

    Correct, knowing what your filesystem does is your problem. The filesystem buffer will say 'Ok I wrote that' and MySQL can move on, even if it is living in a buffer before being written. Not a big deal if you're aware of it, but MySQL doesn't give me an easy way to change it, or to specify WHICH tables/databases NEED to be O_SYNC'ed or not. That is what I wanted - recompiling MySQL and having EVERYTHING or NOTHING buffered is not acceptable. There are certain tables or databases I KNOW will benefit from buffering, but with MySQL it's all or nothing.

    Rebuttal: So set up a dedicated slave for backups. Turn off the slave while backups are running, it catches up when backups are done and it is brought back up. A *simple* solution to a *simple* problem. If you really feel the need to do a hot backup of your live server, you can check into using InnoDB's tool at http://www.innodb.com/hotbackup.html .

    Ok, so I have to now get another boxen set up just to backup my database? How is getting another box, setting up replication, pausing replication, dumping, etc. etc. 'simpler' than saying 'dump database bob' and having MySQL do the rest for me? And I did point out InnoDB has a hot backup but that does work only with InnoDB.

    Rebuttal: You mean like backing up the raw MyISAM files? Of course, that doesn't work with InnoDB databases, so you can use their hot backup tool for that as well, if this is a REAL (rather than IMAGINED) problem.

    That only works if you offline your DB while your copy is being done. Again, not acceptable and what hot backups for ALL MySQL tables would fix.

    Argument: I have to wait for 4 million INSERTs to be performed...
    Rebuttal: RTFM. No you don't.


    Well, certainly you can always use 'CONCURRENT' but in practice that is not terribly useful. Why? Well my 4 million load operation will take LONGER to perform, and sure people can query it now, but I have no indexes on the table so all queries will now table scan. So I suppose you're right, you don't have to lock the table for the whole operation, but in reality, your app won't run very well at all (are writes allowed to the table while you're loading?).

    Rebuttal: Again, is this a real or imagined problem? It's likely that whatever you are trying to do, there's a better way. Unfamiliarity with a particular tool usually results in this type of problem.

    It can be - depending on your OS and whether or not you have it configured for large file support. But again striping it can have significant performance advantages since I could dump AND load to multiple disks that leads to a significantly higher throughput rate.

    Rebuttal: So because YOU don't like the output of EXPLAIN you're saying MySQL isn't ready for production? WTF are you talking about?! As for a more *in-depth* EXPLAIN, I agree there, and I found PostgreSQL's mechanism kind of cool. Of course, in four years of running MySQL in a production environment, I'm not sure I would have used it more than once or twice; MySQL's EXPLAIN has always been sufficient, if you actually know what you're doing.

    Not necessarily 'production' use, but production use in a highly trafficked environment.

    RTFM. You are obviously unfamiliar with the slow queries log where MySQL gives you EXACTLY the information you are looking for. As for the data cache and whatnot, I don't know if that is actually available or not.

    Yes I've read the manual and seen the slow-query-log portion. However the log does not log the currently running SQL, only after it has completed. If my server is slow NOW I have to wait till whatever is blocking everything to complete BEFORE I knew what happened. I'd like a way to see RIGHT NOW what is going on, so if I see a rouge query performing a Cartesian product I can easily kill it and life can move on. The slow query log does not fit the bill.

    No, there isn't a way to manage the data cache aside from setting config options on sizes of key caches and the like. I can't create dedicated caches to certain tables which is quite useful, nor can I change the I/O sizes of the caches if I know queries being performed on them would like 16K I/O vs 4K or whatnot.

    Rebuttal: And your evidence? Oh wait, you didn't actually provide any. You just brought up a tangential issue...

    Part of it comes into the fact that I can't manage index statistics (or even see them), can't tell what types of joins are being performed, etc. and the fact that the optimizer is somewhat 'young'. Now, simply because I can't see statistics doesn't mean the optimizer isn't using them, but I can't gauge how well they are being used, and I suspect the optimizer isn't as advanced as others. Optimizers are weird creatures, and with time it will certainly improve. However many-table joins are consistently slower in MySQL than many others - I'll see if I can't get test data up and run some quasi-useful benchmarks but I've seen this time and time again in properly normalized, indexed tables queries which run on Sybase ASE, Oracle, etc. with nontrivial amounts of data do not run as well on MySQL (which touts SELECT speed as their main advantage, I guess complicated SELECTs are not as nice).

    Rebuttal: If you are that concerned, you have some good options here. (a) Pay the developers to hold your hand and explain to you what has happened. (b) Use the source and do your own friggin' diff. This is Unix; stop acting so helpless.

    We don't use MySQL in a production environment, so I'm certainly not going to pay or waste my time coding. But MySQL.com seemingly touts that they are #1 in so many aspects and conveniently glosses over some issues which are important to those who write and manage large applications. I'm simply pointing out where they need work, and if they're serious about their claims then they should have no problem whatsoever implementing them.

    Dude, have you not even looked at MySQL since 3.21 or something? Row locking is available in InnoDB, as are transactions. Stored procedures and triggers are planned for 5.x IIRC, but so many applications DON'T need them that the MySQL folks simply haven't cared to add them. Ditto for views (which are also slated for 5.x).

    As I said in another post, I do lots of consulting and yes, I read the MySQL docs quite often. InnoDB does provide row locking, but at a cost of performance and memory. If you know much about how large-scale applications are built (which is what I think the comment author asked about) you know how well stored procedures and triggers are used. He asked if MySQL 4 (over something like PostGRES) was suitable in a high-trafficked environment. Those features are a serious part of any non-trivial application.

    --

    Thanks,
    --
    Matt
  46. Postgresql Install by nullard · · Score: 2, Interesting

    I would gladly try Postgres as it has some features that are currently missing from MySQL. But I don't feel like dealing with it.....

    I've installed PostgreSQL five or six times. IIRC it involves seting a pair of environment variables, creating a user, and using configure and make. I was able to do it right after completing my first Linux instalation. I didn't find it difficult or even mildly challenging. The documentation is really good.

    --


    t'nera semordnilap
    1. Re:Postgresql Install by sg_oneill · · Score: 2

      No postgres apt's into place pretty nicely (woody). I must admit being a little befuddled working it out at first (just the security settings) but the everlovin' webmin (apt-get install webmin-postgres) seemed to magic it all good. None the less, for web stuff we still usually float with My-sql as dreamweaver-mx now copes with it natively (keeps art-troggs happy). Heads up to Macromedia here, ppl actually DO use postgres.

      --
      Excuse the Unicode crap in my posts. That's an apostrophe, and slashdot is busted.
  47. Re:Stable? Maybe. Worth it? Not yet. by zak_greant · · Score: 3, Informative

    Hey,

    Thanks for the critical feedback - however, you have some information that is not accurate.

    On the positive side, your criticism has provided some interesting ideas! :)

    REPLICATION
    You are correct that the binary log stores the SQL data modification statements that were applied to the master, rather than the actual
    changes that were made to it. You are also correct that if something goes wrong, the DBA is the one who gets to fix it.

    It does not assume that the master and slave are equal - it does assume that the slave contains an linear subset of the data on the
    master.

    We have users working with replication in high-demand situations and it is performing well. Could we improve it? Of course - I was just
    browsing through the slides from the PostgreSQL Replication talk at OSCON and it looks like some very cool things are going on - we should
    watch and learn. :)

    TABLE LOCK LATENCY
    It is true that table-level locking used by MyISAM performs poorly under heavy concurrent read/write.

    If this is an issue switch to the InnoDB storage engine (which uses low-cost, non-escalating row level locking) or the Berkley DB storage
    engine (which uses page-level locking).

    InnoDB uses a single bit to indicate if a particular page stores rows that are locked. If any rows are locked in the page, then a few more bits are needed for the page to indicate what particular rows are locked.

    FILE SYSTEM BUFFERING
    File system buffering can be a thorny issue. The InnoDB storage engine forces a flush to disk upon the commit of every transaction and
    then writes a checkpoint so that it knows when the last flush was made.

    INDEXING
    This is just plain wrong. Of course MySQL can use more than one index in a query!

    CLUSTERED INDEXES
    MyISAM tables can be optimized so that the order of the rows in the table matches the order of the indexes on the table.

    InnoDB tables already use clustered primary key indexes. Secondary indexes refer to the primary key values.

    ON-LINE BACKUPS
    Replicate the database out to another server (even one on the same machine), then stop the slave to take a backup.
    This has the added benefit of being able to ask the slave to take over from the master when you need to maintain the master.

    BACKUP FORMAT
    Use the binary log instead of the mysqldump tool - it uses a compressed binary format that is much more compact.

    Also, if you have to recreate a table from a mysqldump, then disable indexes until you have recreated all the rows - will save a good deal
    of time on bigger tables.

    Dumping the indexes is probably not a bad idea though. :)

    DUMPING TO MULTIPLE FILES
    An option to allow dumping to multiple files would be convenient. :)

    In the past, I just asked mysqldump to dump to stdout and have a perl script handle the segmenting.

    The binary log does get segmented into multiple files automatically. I will ask the developers if it would make sense to make a new dump tool that works with the binary log format so as to get the benefits of that format.

    BETTER TOOLS...
    Duly noted - the output from EXPLAIN is cryptic.

    DELVING DEEPLY...
    Absolutely - we could use more tools to give detailed performance information. The current tools that report the number of active threads,
    the number of questions run, the memory currently used, the max. memory consumed, etc. are not enough. We have some graphical tools like MySQL-Graph (A GPL'd app) to make review of the data easier.

    Also, slow queries is more than a counter. The slow query log stores details on every query that ran over the value of the long_query_time
    setting. Use the mysqldumpslow tool to give a summary of data in the log file. The log can also record queries that did not use an index.

    QUERY OPTIMIZATION
    On what knowledge do you base your assertion that the query optimizer is 'PISS POOR'? Do you understand the code behind it? Have you run
    benchmarks to compare its performance to another optimizer?

    Of course we keep optimizing for specific cases. We want to continue to improve performance whereever possible. We have spent a good deal
    of effort doing broad optimizations - the optimizations that have the greatest benefit for the most queries. Now we are work more on
    tweaking specific cases.

    MISSING FEATURES
    The Berkley DB storage engine uses page level locking.

    The InnoDB storage engine uses row level locking (without resorting to lock escalation :)

    We have excellent transaction support - likely the best of any available database today. InnoDB supports the repeatable read transaction
    isolation level. However, due to how we implemented our multi-versioning support, we don't get phantom reads. This is a higher level of transactional isolation than MS SQL, Sybase, PostgreSQL, Interbase, Ingres, etc. IIRC, only FireBird and Oracle may be the same.

    Sub-selects should be out very soon. We are still working on stored procedures, views, triggers and full support for referential
    integrity. We know that these features are important. However, we are working on doing truly robust implementations - rushing them out
    will not help anyone.

    END NOTES
    Why does no one mention the stuff that MySQL is good at? :)

    We are fast - we have third party confirmation that we are faster than DB2, MS SQL and Sybase. The test even confirmed that we perform about as well as Oracle (a bit slower :) when running under Windows using a JDBC driver.

    We don't need to stop the database to vacuum or do many maintainance tasks.

    We know that we can run in critical environments because we have users like Yahoo! Finance *and* Slashdot :) using us for critical, high-load applications.

    We are a fully-threaded app and can take full advantage of SMP machines.

    We can run natively under a bunch of OSs - including Windows.

    Our ability to use different storage engines gives users great choice in how to manage their data. If someone needs a lightweight format in a non-transactional environment, use MyISAM - it has very little storage overhead and is speedy in situtations where you do not have many concurrent reads/writes.

    If you need really robust transaction support that ensures the integrity of your data, use the InnoDB storage engine. Storage overhead is more than with MyISAM tables, but that is not generally an issue for enterprise level users.

    I can hear people grumbling - well, the transaction support isn't integrated, so it isn't valid... That is complete junk - since when is choice a bug? That is like saying that the Linux is not a modern operating system because its default filesystem does not use journaling. Usually, is it only the proprietary and/or less advanced operating systems do not give you a choice of file system.

    Also, we can easily add in new storage to support specific needs. Look at how quickly InnoDB was integrated - it suddenly took us from having no transaction support to having great transactional support. Without the storage engine concept, we would have had to do a lot more work to get it integrated.

    blah blah blah... :)

  48. Re:What use is the UNION statement? by Noel · · Score: 2
    Than you Noel!

    Any time...

    FWIW, I rarely have need for UNION, but when I do it's a lot better than multiple INSERTs into a temporary table followed by a SELECT and a DROP.

    It's always fun to dive into the relational algebra behind it to get a better idea what's going on. If you're interested, this page has a good summary of relational operations, although it doesn't give direct mappings between the examples and standard SQL. Interestingly enough, 6 of the 10 examples would be done with a JOIN in SQL, and only one would need a UNION...

  49. Re:Stable? Maybe. Worth it? Not yet. by AKAImBatman · · Score: 2

    Zak,

    Putting aside what MySQL is and isn't good at, I'd like to ask that when you guys implememt features, you do them according to SQL specs. As the author of DataDino, a database management tool, I've been bitten several times by MySQLs lack of SQL 92 adherance.

    For example, the SQL specs state that identfier tokens (e.g. table names, column names, etc.) can be encaspulated in double quotes. The only problem is that MySQL uses the accent sign (`) instead of quotes. All the code that was ok for nearly every other database on the planet, is suddenly not ok for MySQL. Very bad.

    Simple things like this can go a long way toward people taking MySQL more seriously. As it stands, you may manage to get all the standard RDBMS features in, but it won't be compatible with anyone. Thus MySQL will not be accepted until this changes.

  50. Comment removed by account_deleted · · Score: 3, Informative

    Comment removed based on user account deletion

  51. Re:Stable? Maybe. Worth it? Not yet. by peyote · · Score: 5, Informative

    If we're talking about high trafficked sites, I'm pretty sure our sites in my last job would qualify: around 80M-90M page views per month. Granted it isn't ``upwards of 100 million imp/mo.'' but I don't expect to get into a d*cksize war about that. :-) (Also, the great majority of these were PHP pages doing various things against our MySQL database.)

    Right, and the slave goes down. So I have to manually intervene to fix it. That is unacceptable.

    I'm not really sure what you mean here. The only replication problem that would require manual intervention is in a multi-master setting where MySQL gets confused about which query comes first. (And they don't even officially support such a config.) In a typical failover setting, if a slave dies, goes down, whatever, it rebuilds itself when it comes back up, no intervention required.

    As for just quitting and saying 'oops', I think that was a problem with MySQL's replication a number of versions ago, probably one of the first versions it was officially in the source (complete with dire warnings, of course).

    Finally, as for Yahoo!'s total MySQL traffic, we actually outran that by quite a bit at my last job. We were seeing sustained averages (over a number of months) of nearly 180 queries per second, with a maximum of 1000 concurrent. Is that worth writing home about? ;-)

    Correct, knowing what your filesystem does is your problem...

    Maybe I'm misunderstanding, but this REALLY doesn't seem like it's MySQL's job. If you want a database to be O_SYNC'd, `chattr +S the_directory`. (Granted you cannot do that on a per-table level.) Want the whole thing sync? `mount -o sync the_filesystem/`.

    Ok, so I have to now get another boxen set up just to backup my database?

    Yep. Or you can get one box that acts as a slave for all five/ten/whatever of your MySQL pools and back them ALL up from one box, rather than five/ten/whatever.

    ...pausing replication...

    No no no no no. You don't have to pause replication. Really. I promise.

    etc. etc.

    No, there is no etc. etc. You described it just fine in a few simple steps. At least in our application, this eliminates any need whatsoever for hot backups. YMMV, use the right tool if you determine that to be something else. But to say that is doesn't work is simply false. I can demonstrate that it does work, and it works well, even in a production environment with a healthy bit of traffic.

    P.S. If you are still really bent on this hot backup business, check out `perldoc /path/to/mysqlhotcopy`.

    Question: why are you doing lookups on a table that is in the process of being loaded? Do you do lookups on a table while you are restoring it from backup? Aren't you running the risk of getting bad data out in any case? Yes, you do have to wait for the operation. No, that does not mean that you have to do 4 million serialized INSERTs.

    Yes I've read the manual and seen the slow-query-log portion. However the log does not log the currently running SQL...

    Okay, if that's what you want, use SHOW FULL PROCESSLIST from the MySQL monitor. Done.

    As for some of the data cache issues, I still don't purport to know much about that, but ISTR a lot of talk from Monty and the other MySQL team at OSCON about this sort of thing in 4.x and 5.x. We'll see over the coming months...

    As for the optimizer, you're right, I can't see it either. Neither have I ever needed to, since it just doesn't come up. At least in our application, MySQL seems to get it right every time. (No, this isn't a proof. Yes, it's anecdotally helpful to the OP, I think.)

    We don't use MySQL in a production environment, so I'm certainly not going to pay or waste my time coding. (regarding vague Changelog entries)

    Okay, maybe the Changelog could be more verbose. (Personally, I'm happy with the amount of information in the Changelog.) But those who write and manage large applications, if they are truly concerned about this sort of thing, should have the expertise (either in-house or via a MySQL support contract) to squeeze every last ounce of performance out of the database. In the same way, they should be able to track changes in a more specific way. Maybe not you, since you don't run MySQL in production, but those who *do*, *can*.

    InnoDB does provide row locking, but at a cost of performance and memory.

    I'd be interested to see the application that provides row locking for free. :-)

    If you *NEED* those features (note that need does not just depend on the size of an application), use them, either in another package, or when MySQL gets them. I've seen plenty of non-trivial applications that run just fine on MySQL in production and high-trafficked environments. Size and volume do not constitute a feature need.

  52. Re:Stable? Maybe. Worth it? Not yet. by zak_greant · · Score: 2, Insightful

    Currently, you can ask MySQL to become ANSI compatible by starting the server with the --ansi flag. When this is enabled, MySQL uses double quotes as the identifier delimiter.

    The drawback with this is that it still has to be enabled on a per-server basis and many people do not run with it enabled (nor do they want to have it enabled).

    This does make life difficult for tool developers and porters.

    I will raise the issue with our developers and will reply to you as soon as I hear something.

  53. Re:Stable? Maybe. Worth it? Not yet. by MattRog · · Score: 2

    Yes, I mis-spoke. 30 million pg view. Which many of them are writes, unfortunately. :D If they were reads we wouldn't have hit MySQL locking problems, and live would've been good.

    --

    Thanks,
    --
    Matt
  54. Better Question by eples · · Score: 2


    MySQL 4 - Is it Stable?

    Better question is: "Is it ANSI SQL-92 compliant?"
    No. It is not. MySQL does not conform to even a 10 year old SQL standard.

    --
    I'm a 2000 man.
  55. I'll use MySQL 4 when... by danpbrowning · · Score: 2

    I'll use MySQL 4 when Slashdot upgrades to it. :-)

    --
    Daniel
  56. MySQL by nerdin · · Score: 2

    After 20 years working with virtually every DBMS in the market I'd simply discarded MySQL in favor of Postgres.
    MySQL is to Open Software what Access 1.0 was to closed Software. Sorry to say that.
    Lame, lame "database" that ignores everything except CREATE, UPDATE, INSERT or DELETE. [where]...
    No joins, no views, no foreign keys, no subqueries, no stored procedures, no transactions, no row locking, no dirty reads, no REAL gain in speed. I don't know what some MySQL supporters call an "application", but I'd really like to see MySQL trying to run a real production environment with a few hundred (oh, preferably around a thousand) concurrent users in a highly transactional environment, using a hundred-table database. Yeah, right. Go ahead. I know people that also tried with dbase III / Clipper on DOS. Some of them even survived.

    1. Re:MySQL by Star_Gazer · · Score: 2, Insightful
      Yep, and I'am sure you are driving to the super market with your giant 30 (metric) ton Truck...

      What is wrong with all you guys mocking about MySQL not being a "real" database and basically calling its users idiots? It's all about the right tool for a job - and MySQL is OK for some applications. It's lightweight, extremely easy to use, very fast and easy to install and administer. Other systems may share some of this pro's and even offer (significantly) more, but if it's enough for a given app, why don't use it?

      BTW, I know some systems that still run dBASE databases - and they are working fine and do what they are expected to do.

    2. Re:MySQL by nerdin · · Score: 2

      Don't mince words. Please quote when I said idiots.
      By any means, whatever you want to say, it looks to me that MySQL is a very poor choice as a dbms: an overkill for single user, few table apps and too small for real day to day robust applications.

      >BTW, I know some systems that still run dBASE databases - and they are working fine and do what they are expected to do.

      Corrupting every other day?

  57. Re:Duh by Quila · · Score: 2

    As aminorex said, large dataset != large app. I was working on a MySQL to go through gigabytes of server logs. It was a very small app, just lots of data for it to go through very fast.

    As for corruption, etc., I haven't heard our slashdot admins complaining about it -- even kept up through the 9/11 traffic.