rlange - 3:12 pm on Jun 11, 2012 (gmt 0)
I'm a bit late, but...
I'm not sure how well the
ORDER BY clause works when you use a function, or what kind of optimizations or caching are done, but something worth trying might be to give the result of
COUNT() a name and then
ORDER BY that name.
SELECT COUNT( `my_item` ) AS `item_count` [...] ORDER BY `item_count` [...]