4 ms·
10 tips for optimizing mySql queries
- bradgessler 18y agoCOUNT() incurs no additional cost for a well-structured query "Well structured" query meaning there is no WHERE clause...
- jrockway 18y agoSQL is Not C <example code> I would be very surprised if the optimizer did not treat his two example queries the same.
- iigs 18y agoIn the earliest versions of MySQL that supported subqueries IIRC you could see different EXPLAINs for what, to me, appeared to be equivalent queries. That is to say, I don't believe the query optimizer is/was MySQL's key feature at that time. Then again, it wasn't that long ago (2003) that MySQL 4.0 came out. Before that the subquery format was a syntax error. :/
- truebosko 18y agoNothing like trying to read an article on mySQL optimization and I get "Error establishing database connection" .. :(
- jfarmer 18y agoI guess I deserved that...heh. My WordPress cache plugin got disabled in one of the many upgrades. Instead of serving 400 requests per second my server was serving less than 1. Man, WordPress performance sucks...