一个很奇怪的问题,我有一个存储过程,运行非常慢,在通过SQL跟踪得到的执行计划中,有几条语句按照主键查询竟然走的是全表扫描,而我查看执行计划它又走的不是全表扫描,其中ROW_ID是主键,正常道理下应该很快的.
另一方面我把该语句单独取出来,查看执行计划,执行计划
很正常,走的是主键索引,以下是该语句的TRACE跟踪文件.
哪位碰到过类似情况盼指教.
********************************************************************************
select material
from
WL_INPUTDATA_TEMP where rownum = :"SYS_B_0" and row_id =:"SYS_B_1"
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 136 0.01 0.01 0 0 0 0
Execute 136 0.00 0.00 0 0 0 0
Fetch 136 8.60 458.55 128720 495060 0 136
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 408 8.62 458.57 128720 495060 0 136
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 60 (recursive depth: 2)
Rows Row Source Operation
------- ---------------------------------------------------
1 COUNT (cr=3640 r=3137 w=0 time=12387163 us)
1 FILTER (cr=3640 r=3137 w=0 time=12387159 us)
1 TABLE ACCESS FULL WL_INPUTDATA_TEMP (cr=3640 r=3137 w=0 time=12387152 us)
********************************************************************************