求教一个问题,标题长长的~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
我测试下面这sql语句时发现:
第一次:
select count(*)
from temperature t
where t.t_checktime >=
to_date('2013-03-21 00:00:00', 'yyyy-mm-dd HH24:MI:SS')
and t.t_checktime <=
to_date('2013-04-10 23:59:59', 'yyyy-mm-dd HH24:MI:SS');
COUNT(*)
----------
743360
执行计划
----------------------------------------------------------
Plan hash value: 4082582504
--------------------------------------------------------------------------------
-------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Tim
e |
--------------------------------------------------------------------------------
-------
| 0 | SELECT STATEMENT | | 1 | 7 | 3220 (1)| 00:
00:39 |
| 1 | SORT AGGREGATE | | 1 | 7 | |
|
|* 2 | INDEX RANGE SCAN| IDX_TEMPERATURE_2 | 76271 | 521K| 3220 (1)| 00:
00:39 |
--------------------------------------------------------------------------------
-------
第二次:
select count(*)
from temperature t
where t.t_checktime >=
to_date('2013-03-21 00:00:00', 'yyyy-mm-dd HH24:MI:SS')
and t.t_checktime <=
to_date('2013-04-11 23:59:59', 'yyyy-mm-dd HH24:MI:SS');
COUNT(*)
----------
777600
执行计划
----------------------------------------------------------
Plan hash value: 2391986960
-----------------------------------------------