6 ms·
MySQL is also generally poorly "designed". MySQL is to a database as PHP is to a programming language.
by TazeTSchnitzel 13y ago
MySQL is also generally poorly "designed". MySQL is to a database as PHP is to a programming language.
- RobAley 13y ago> MySQL is to a database as PHP is to a programming language. Yup. They're both easy to work with, highly productive, widely supported and tooled, and suitable for a very large number of projects.
- jhh 13y agoI feel that both your remark and the one you were reacting to are strangely correct and do not contradict each other. MySQL does "simply" work for many projects, especially if the number of rows doesn't go much higher than a few million. Similarily, while the design of PHP must be considered terrible in some respects, it certainly allows you to quickly create webapps and ist does so in a way that is rather "native to the web". But I think if you start non-trivial new projects on the PHP+MySQL stack today you are just lazy. Python (for example) with modern frameworks and Postgres gives you virtually all the advantages with fewer of the downsides and many nice extras like a more vibrant higher quality ecosystem and a better designed language.
- rimantas 13y agoEven trivial projects become non-trivial when they reach the scale of Wikipedia or Facebook. I am a bit surprised that nobody mentioned MySQL lacking transacion support in this thread, because otherwise a lot of comments sound "I don't really try to use/learn it, but I heard it is a toy db, and PG is real DB". Well, ok.
- MrBuddyCasino 13y agoMySQL lacks transaction support? Unless you use MyISAM tables, that isn't true since like forever. For the record, I prefer Postgres over MySQL any day.
- Xylakant 13y agoThere's a couple of things that you can do with PGs transactions that don't work in MySQL, for example transactions around DDL statements. That can leave you with quite a mess at your hand when you have to rollback half a database migration.
- debacle 13y agoYou're ruining the circlejerk.
- MagicWishMonkey 13y agoI've heard lots of complaints about mysql, do you know if query deadlocks are more common with mysql than with something like postgres? I've been running into that a lot lately, and I don't understand what the hell is going on. None of the queries I'm executing have particularly long run times (usually a few milliseconds, occasionally 100ms), but I still get random deadlock errors from time to time. I've never run into this on any other database platform (most of my experience is with Oracle and SQL Server), and I have no idea what the hell is going on.
- xd 13y agoDeadlocks have little to do with queries and everything to do with transactions. They happen for a very good reason and never happen "randomly". I assume you are using the innodb storage engine: http://dev.mysql.com/doc/refman/5.7/en/innodb-deadlocks.html http://dev.mysql.com/doc/refman/5.7/en/innodb-deadlocks.html
- morgo 13y agoI think this would be a difficult question to answer, without knowing the specific case why you are getting deadlocks. What you want for best performance is optimistic concurrency control. Which means that you need to allow for "deadlocks happen".
- VLM 13y agoWe also have no idea whats going on with your system. I ran into this twice that I can recall. Once was a pathological SELECT FOR UPDATE where it was locking up way too much stuff, and another was a time where a boring looking update was locking a whole bunch of seemingly unrelated indexes. So for the two examples I ran into all I can say is make your transactions as small as possible and take a close look at ALL the indexes especially if you think they're unrelated. There's an option for logging the intimate details of deadlocks into the log file (or error file or whatever it was) anyway the main PITA is having to restart the server to enable it. On second thought the real PITA is operational in the "watched pot never boils" tradition as soon as you enable it the intermittent problem seems to go away, just dumb luck.
- 13y ago