Unanswered: How to optimize ORDER BY query with COUNT() and GROUP BY.
I have one query like
Select field_1, count(field_2) as cnt from Table_1
where field_3 like '%abc%' and field_4 like '%def%'
Group By field1
Order By cnt DESC
How can i optimize this query b'coz without Order By this takes 0.417 second but when we enter ORDER BY then it takes 4 to 5 seconds.we can not make index on count field...so now wht should i do to make this query fast???