Query :
select field1 as Word,count(*) as Count from TestAdd1214190 group by field1 order by count desc
Btree Index created on field1 column
Data In table 50 lac
Engine : MEMORY
Explain
TYPE: SIMPLE
USING INDEX;USING TEMPORORY;USING FILESORT
Please suggest how do i make this query fast
As
Count(*)is optimized by MySql there could be performance differences on which column you use. You can try to usCount([index field name])instead.Refer to: http://www.mysqlperformanceblog.com/2007/04/10/count-vs-countcol/ for more info on this matter.