表结构
iMoney 类型:float dtEventTime 类型:datetime iType 类型:tinyint iAction 类型:tinyint
现在存在的索引(test)是:
iType 跟 dtEventTime 的一个组合索引
select sum(iMoney) as iMoney,iAction from CostMoney where iType = 3 and dtEventTime between '2012-09-29' and '2012-09-30' group by iAction
这条语句查询后explain 下
id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE CostMoney range test test 9 NULL 3893 Using where; Using temporary; Using filesort
幕布斯7119047
aluckdog
相关分类