# SQL 语句执行计划不准 - 结果验证
```
mysql> select count(*)
    -> from tods.bus_jijin_trade_record a, tods.bus_jijin_info b 
    -> where a.fund_code=b.fund_code and a.type in ('PURCHASE','APPLY')  
    -> and a.status='CANCEL_SUCCESS' and a.pay_confirm_status = 1 
    -> and a.cancel_app_no is not null and a.id >=  177045000  
    -> and a.updated_at > date_sub(now(), interval 48 hour) ;
+----------+
| count(*) |
+----------+
|      712 |
+----------+
1 row in set (1.69 sec)
```
-------------------------------------------------------------
```
mysql> select count(*)
    -> from tods.bus_jijin_trade_record a, tods.bus_jijin_info b 
    -> where a.fund_code=b.fund_code and a.type in ('PURCHASE','APPLY')  
    -> and a.status='CANCEL_SUCCESS' and a.pay_confirm_status = 1 
    -> and a.cancel_app_no is not null and a.id >=  177045000  
    -> and a.updated_at > date_sub(now(), interval 48 hour) ;
+----------+
| count(*) |
+----------+
|      712 |
+----------+
1 row in set (1.69 sec)
```

此时执行时间变为 1.69s ，在执行计划没变的情况下，应该是由于缓存命中率上升带来的提升。
可以看出该 SQL 执行效率变差是由于统计信息不准确造成的，在通过收集统计信息之后得到了正确的执行计划。
从最终结果 712 行记录来看，创建复合索引可以更大的降低扫描数据的量，更进一步提升性能。在性能已经满足业务要求情况下，复合索引会有额外的成本，留待以后尝试。
