4 ms·
He doesn't know what he's on about, but he likes MySQL. You're putting words in my mouth that I didn't say. I don't like MySQL. I prefer PostgreSQL. And I have
by barrkel 12y ago
He doesn't know what he's on about, but he likes MySQL.
You're putting words in my mouth that I didn't say. I don't like MySQL. I prefer PostgreSQL. And I have had a few rough times optimizing some queries in PostgreSQL, whereas I've had fewer such bad times with MySQL, despite using it more often. It's anecdata. Take it for what it's worth.
Time sinks in MySQL have come more from its crappy defaults, from its bizarre error handling (or lack thereof) in bulk imports, and most recently, a regression caused by a null pointer in the warning routine.
If I were working on my own project, I'd probably go with PostgreSQL and figure out the replication story. But I'm not. I do use PostrgeSQL on my personal projects.
(If there was one feature I'd add to PostgreSQL, it would be some means of temporarily and selectively disabling referential integrity. Not deferring it, not removing and readding foreign keys, just disabling. The app I work on does regular 10k-1M+ row bulk inserts, usually into a new table every time (10s of thousands of tables), but sometimes appending to an already 100M+ row table. It would be nice to have referential integrity outside of the bulk inserts, but not pay the cost on bulk insert.)
- joevandyk 12y agoYou can disable all triggers in a session. set session_replication_role='replica'; If memory serves me correctly. Foreign keys are maintained by triggers.
- deleted 12y ago[deleted]
- random_number 12y agohttp://stackoverflow.com/a/2681413 http://stackoverflow.com/a/2681413 SET CONSTRAINTS ALL DEFERRED Then do your inserts, followed by whatever work needs to be done without referential integrity, in the same transaction.
- noehp 12y agoTake responsibility for what you wrote. Here are some of your words, and the obvious implications: > performance needs a very careful eye Clearly implying that performance doesn't require a careful eye on MySQL. Which is utterly idiotic and wrong. Though you've proven yourself sufficiently dishonest that I'm sure you'll pretend that you never implied any such thing. You also wrote: > makes it easy to do silly things, like turn off referential integrity in a slow query to boost performance. Which is really misleading, because it ships with most of that stuff off. It's not possible to turn it off, it's HARD TO TURN IT ON. Seriously. Try making MySQL treat your data the way you'd expect (always throwing errors in situations where something that's invalid by the SQL standard has happened). It's hard. And if you said 'just turn on strict mode', then you've clearly never tried to catch ALL of the edge cases. MySQL is a horrible tool. The only good thing about MySQL is that it's such a piece of shit that a whole generation of devs decided to try to experiment with NoSQL tools because they didn't understand the difference between 'things that suck about MySQL' and 'things that suck about SQL'. That ignorance has spawned some interesting projects. I didn't put a single damned word in your mouth. You're just another pathetic little jerk who communicates stupid and wrong shit and then tries to use pedantry to pretend that you didn't do that. Sorry bro, but you suck at logic, communication, and life. Peace.
- barrkel 12y ago>> performance needs a very careful eye > Clearly implying that performance doesn't require a careful eye on MySQL This is highly ironic, since you later say: > you suck at logic Funny chap! (My point was that all the extra features in PostgreSQL give you more solution space, but not all of the solution space is suited to your problem. You have to watch out you're using the specific features in a way that pays off. Whereas MySQL is a bit like a hammer; you need to shape your problem like a nail, otherwise you won't be able to hit it at all. But when you do hit it, it mostly works. It's not a precision instrument though.) >> makes it easy to do silly things, like turn off referential integrity in a slow query to boost performance. > Which is really misleading, because it ships with most of that stuff off. MySQL ships with referential integrity turned on - InnoDB is the default back end. Care to explain more? (Personally, I wouldn't use MyISAM for my phone book, never mind in production.)
- noehp 12y ago> But when you do hit it, it mostly works. Except that this is not even slightly true. See: join performance, sub-query performance, etc. > MySQL ships with referential integrity turned on - InnoDB is the default back end. Care to explain more? This is... just wow. Wow. I can't even believe that you think 'Innodb is the default back end' == all integrity is present. That's so wrong it's... we're not even having the same conversation. Wow. You're shockingly stupid, even for the Internet. Wow.
- deleted 12y ago[deleted]
- noehps 12y ago" InnoDB is the default back end" This comment reveals that you're utterly and completely ignorant. If you think InnoDB treats your data with respect by default, you've clearly never actually paid close attention to anything.