请教,mysql 千万级别数据 索引创建
表有1千万+的数据
sql:
select apkid
, sum(case when actionname='showad' then actioncount else 0 end) as showad
from appsearch_sdk_uuc_useraction
where dt >=20170301 and dt <=20170310
group by apkid
耗时12s
建了(dt,apkid)的联合索引,没有效果。
请教大神,语句或者索引,应该如何优化~