News for hackers. Stuff that matters.
Re:Use SQL subqueries to count distinct 50x faster by michaelmior on Friday January 24, 2014 @09:25AM (#7114959)
Historically the MySQL query planner has been pretty bad, although it's improved significantly in the past couple years. It was particularly bad dealing with subqueries as you mentioned, although several of the performance issues have been solved in MySQL 5.6.

https://mariadb.com/kb/en/subquery-optimizations-map/

Re:Use SQL subqueries to count distinct 50x faster by falcolas on Friday January 24, 2014 @10:02AM (#7115160)
Yup, this. Of course, it hurts that there are probably less than 10 people in the world who fully understand the optimizer (and the majority are employed by Monty); though I'm sure the MySQL folks at Oracle are getting there.