5 ms·
This doesn't match my experience at all. MySQL performance is highly variable, and it's incredibly easy to write simple queries that have truly abysmal perform
by noehp 12y ago
This doesn't match my experience at all. MySQL performance is highly variable, and it's incredibly easy to write simple queries that have truly abysmal performance.
Postgres on the other hand, has always tended towards making things work well (a step that mysql often skips), and then work quickly thereafter.
A lot of MySQL acolytes say Postgres is slow because, unlike MySQL, it doesn't ship with unsafe defaults. MySQL doesn't just allow you to do dumb things, it starts off with many of those settings as the defaults.
To me, the real problem is that people likebarrkel exist. He doesn't know what he's on about, but he likes MySQL. Most of wheat he wrote is flatly false, but he said it confidently. And he's employed someplace that probably uses MySQL.
MySQL got adoption for two reasons:
1) it used to be easier to install; and
2) it has unsafe defaults that mean if an idiot runs a benchmark, it wins.
That's it. That's how it won market. After that, it was network effects, and nothing else. MySQL is a turd. It requires substantial expertise to use MySQL because it is such an awful and dangerous tool. It slows you down as you get better. But most of the people who use it don't know any better, or (like barrkel) they spew nonsense that is the opposite of reality. So it wins.
Network effects suck.
- laurencerowe 12y agoMySQL also had much cheaper connection setup costs which was a big deal for the CGI and PHP crowds who setup the world at the beginning of every request.
- 72deluxe 12y agoThis is very true. If they used something like pgpool-ii it'd be fine. But that would require more effort for the server administrators.
- threeseed 12y agoA simpler and faster product won ? I am truly shocked. And the issues around "safety" stopped being a concern for most developers a decade ago when the ORM was invented. So this idea that you need "substantial expertise" to use it is simply ridiculous.
- ecopoesis 12y agoI would also say MySQL was adopted by lots of people because for a long time it had a better replication story then Postgres. Easy to setup replication was a pretty killer feature, even if it didn't always quite work as expected.
- empthought 12y agoI think "easier replication" and "unsafe defaults" kind of go hand in hand...
- Gigablah 12y agoSpeaking as someone who made the switch from MySQL to Postgres... I'm just happy that I can now trust subqueries and schema updates to not blow up my database. And I don't know how I got by without lateral joins and hstore.
- barrkel 12y agoHe 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.
- skrebbel 12y ago> To me, the real problem is that people likebarrkel exist. Seriously? you're getting worked up about a database and you conclude that it would be better if certain people didn't exist? I'd like to remind you that this is HN, not the Linux kernel dev list. For all its flaws, HN still is about civility. You just wished someone out of existence over a database, can you please stop that? Grow up!
- 72deluxe 12y agoI have noticed that comments here are getting abusive. I got replied to with a post full of profanity for making an observation on GNOME, not taking sides on either cases for the argument. It makes for an uncomfortable community.
- barrkel 12y agoHe got worse. https://news.ycombinator.com/item?id=9022358 https://news.ycombinator.com/item?id=9022358 He created that account to "go after" me with a lot of vitriol. It's a bit mysterious though. Why would someone work themselves up into such rage over a database? Normally, you'd explain this as teenage frustration or something. But he's clearly very unhappy, lashing out. More mystifying than offensive, since it's impossible to take seriously. How can you deal with these people.
- 72deluxe 12y agoIt can be quite upsetting though, particularly with the vitriolic posts from complete strangers. If it was from someone I'd known for years I would cope with it better because you can just shrug and agree to disagree, no need for real offensiveness in any situation though. But from complete strangers who are hammering profanity and abuse into their keyboards as hard as they can, that is quite unnecessary and doesn't make for a nice community. If someone was speaking the things some people on here post to my face, I'd be incredibly offended and they wouldn't be the sort of person you'd want to work with, hang around with or even live next door to. But they don't seem to mind typing it???? These posts rear their head in C++ articles and anything to do with OSX it seems. Really disappointing. I suppose the best way to deal with it is just detach from it for a while, use another forum, go outside, look at the birds or stroke a cat or something. There's something very therapeutic about picking up a fluffy cat (I have 4 British Shorthairs, great for fussing) or simply watching sparrows and small birds go about their business in the dust or seed feeders. They continue working without worries, but work hard to survive still and seem happy about it (as far as a bird can be happy). I find it a contrast to us sat in yellow-lit offices with deadlines, stresses, possibly incompetent managers/colleagues and concerns about our existence/paying bills etc.
- juliangregorian 12y agoWhy are you coming down so hard on barrkel, it seems like you essentially agree!?
- deleted 12y ago[deleted]
- tkyjonathan 12y agoAs a MySQL DBA, I can tell you that neither MySQL nor Postgres are slow. MySQL has less features than Postgres and that was intentional. MySQL was supposed to be a basic feature set that serves 90%-95% of websites and has easy to set up replication. MySQL has always had more the mentality of light weight and fast. Postgres is a fine database. It has a lot of features I would like to see in MySQL. However, Postgres is still fighting issues with regular replication while MySQL is now progressing to sync/group-replication. The features that Postgres already has can be solved in MySQL, but take some work. Sometimes they require me to use temporary tables and pre-calculated summary tables. MySQL's speed is only variable by the queries that are run against it. MySQL is "simple enough" for developers to write queries for it and in 10%-20% of those cases, those queries could be a bit more optimal or the data model could use some more tweaking. In terms of getting things done, you can do a whole lot before needing someone like me to come along and tweak things. A performance audit from someone like me every 6-9 months after your company's website has been in use for >3 years can be perfectly fine. Also the main reason MySQL won out back in the 90s was because they had better documentation and answered questions on their forums faster.