添加注释和取消的区别,F5查看效果,执行时间对比
强制执行索引范例
SELECT COUNT(1) FROM (select * from vav_stbms_tb_act_source_2012 where cstart_time >= to_date('2011/11/1 02:00:00', 'yyyy/mm/dd hh24:MI:ss') and cstart_time < to_date('2011/11/2 02:00:00', 'yyyy/mm/dd hh24:MI:ss') and creceivenetworkid = 2001 UNION select /*+index(vav_stbms_tb_act_source_2012 VAV_SOURCE_INDEX2)*/ * from vav_stbms_tb_act_source_2012 where creceivedate >= to_date('2011/11/1 02:00:00', 'yyyy/mm/dd hh24:MI:ss') and creceivedate < to_date('2011/11/2 02:00:00', 'yyyy/mm/dd hh24:MI:ss') and creceivenetworkid = 2001) /*cbo*/ /*rbo*/