- 论坛徽章:
- 0
|
回复 7# sosflyer
你两个语句是不是一样啊!我的执行结果都一样的.- mysql> explain select extend_type,sum(active_user) from vm_internal_data_201110 where date between '2011-10-01' and '2011-10-26' and extend_type in (11,32,21,7,26,2,17,22,0,30,16,13,23,29,6,27,25,28,3,9,12,15,14,20,4,24,10,19,31,5) and product_type in ('APP','CMPC','AIYH','VMPC','VMWAP','VMCLIENT','WEIYU','PCAPP') group by extend_type,date;
- +----+-------------+-------------------------+-------+---------------------+---------+---------+------+------+----------------------------------------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +----+-------------+-------------------------+-------+---------------------+---------+---------+------+------+----------------------------------------------+
- | 1 | SIMPLE | vm_internal_data_201110 | range | PRIMARY,index_power | PRIMARY | 3 | NULL | 1 | Using where; Using temporary; Using filesort |
- +----+-------------+-------------------------+-------+---------------------+---------+---------+------+------+----------------------------------------------+
- 1 row in set (0.00 sec)
- mysql> explain select extend_type,sum(active_user) from vm_internal_data_201110 where date between '2011-10-01' and '2011-10-26' and extend_type in (11,32,21,7,26,2,17,22,30,16,13,23,29,6,27,25,28,3,9,12,15,14,20,4,24,10,19,31,5) and product_type in ('APP','CMPC','AIYH','VMPC','VMWAP','VMCLIENT','WEIYU','PCAPP') group by extend_type,date;
- +----+-------------+-------------------------+-------+---------------------+---------+---------+------+------+----------------------------------------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +----+-------------+-------------------------+-------+---------------------+---------+---------+------+------+----------------------------------------------+
- | 1 | SIMPLE | vm_internal_data_201110 | range | PRIMARY,index_power | PRIMARY | 3 | NULL | 1 | Using where; Using temporary; Using filesort |
- +----+-------------+-------------------------+-------+---------------------+---------+---------+------+------+----------------------------------------------+
- 1 row in set (0.00 sec)
复制代码 而且你的表有数据,有的表里没有数据,对测试的结果是有影响的. |
|