There was another post allowing people to post their top bad practices in PHP, I had a gripe about MySQL practices and thought it'd be an interesting topic to hear the top bad practices in MySQL.
Up vote the ones you agree with
|
There was another post allowing people to post their top bad practices in PHP, I had a gripe about MySQL practices and thought it'd be an interesting topic to hear the top bad practices in MySQL. Up vote the ones you agree with |
|||||
|
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
|
|||||||||||||||||
|
|
not putting sql keywords in CAPS It kills the readability. |
|||||||||||||||||
|
Sure it's easier to write
but if your site goes viral and you need to scale out in a hurry, it's a LOT easier to throw a few more web servers in than it is to add more DB servers. And if you've kept the heavy lifting on the DB then you're still going to be compute bound on the hardest part to scale. Better to do:
and then sort them in whatever language you're front ending the app with. |
|||||||||||||||||||
|
|
I can't stand it when people use commas instead of joins...
Lets be honest... this is more readable...
|
|||||||||||||||||
|
|
Running on default settings. So your MySQL runs slower and slower. I guess that's because MySQL is crap and you'd better move to Postgres/Oracle/MSSQL/MongoDB, right? Wrong How can it deal with your megabytes of data, if you hardly give it any RAM to load data in? (ok.. maybe this is more serverfault related, by I still think it's something people should be more aware of - default settings are not enough!) |
|||
|
|
|
Writing " |
|||||||||
|
|
Taking advantage of the fact that MySql allows selecting columns no part of the GROUP BY clause. while it does work for many, it leads to bad resutls |
|||
|
|
|
Don't you think that some of mySQL bad practices would also be general to other engines, since SQL is pretty much a standard languages (even if the functionality changes from dbm to dbm). |
|||
|
|