Hacker News new | past | comments | ask | show | jobs | submit login
10 tips for optimizing mySql queries (20bits.com)
14 points by socratees on Nov 15, 2008 | hide | past | favorite | 5 comments



SQL is Not C <example code>

I would be very surprised if the optimizer did not treat his two example queries the same.


In 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. :/


COUNT() incurs no additional cost for a well-structured query

"Well structured" query meaning there is no WHERE clause...


Nothing like trying to read an article on mySQL optimization and I get "Error establishing database connection" .. :(


I 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...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: