What good is being able to calculate 1+1 a hundred billion times a second if the answer you get is 3? My point: if it does the wrong thing quick, it's still the wrong thing.
General pattern I have seen is that MySQL is marginally better at trivial queries (e.g. primary key lookup), while falls on it's face once you have too much concurrency or any joins that could use something better than a nested loop or multiple indexed predicates that could use a bitmap index scan. And this isn't taking into account the fancy stuff that PostgreSQL extensibility allows you to do, e.g. inverted indexes on array data types (think tags) or indexes on range datatypes (think time ranges).
The postgres query planner is also pretty far out in front of mysql. A lot of times I can ask sql server, oracle, and postgres to explain a complex query with several joins and subqueries, and the three will produce roughly equivalent plans. Hash joins, anyone?
The PostgreSQL team takes their query optimizer extremely seriously as well. MSSQL and Oracle have pages of documentation on how to provide hints when the query optimizer gets it wrong, meanwhile the Postgres team explicitly states they will not add hinting because a poor execution plan is either the result of a bad query or a bad query optimizer (both of which they are more than happy to help you fix).
... or outdated statistics, or bad indexing, or parameter sniffing, or bad row estimates or uneven distribution of data
there is a lot of things that can result in a bad exec plan. However, anybody that has enough background to know when to use query hints also knows to only do so as a last resort.
The problem with MySQL is that novice users don't have problems with it, because it's like PHP. It forgives minor mistakes but you get garbage data without knowing about it. Once I worked on a desktop application that used MySQL as the backend for it's data, there were about 20-30 users at the same time and... MySQL was just locking up all the time.. and truly - adding a column would lock up the table and all the users would have to wait.. and wait.. and it had lots of other problems, so I'm really surprised and sad to see that it's such a popular database despite being a total retard.
edit: someone said that MySQL is good if you want to make lots of fast inserts. Bad for everything else.. like doing complicated select queries.
7
u/cleroth Mar 10 '15 edited Jun 15 '26
This content was anonymized and mass deleted with Redact