一、准备
1.参数:
2.查询语句
select style,`type`,uid,sum(money) as money from fa_a where style=1 and `type`=1 group by uid
二、测试结果
1.创建索引 style,type; 查询用时0.695919s
2.创建索引 style,type,uid; 查询用时 3.551894s
3.创建索引 style,type,uid,money; 查询用时0.050138s
第3条 money用到聚合,索引要覆盖到money