今天在使用explain plan for查看sql执行计划时,出现了如下奇怪的执行计划
SQL> explain plan for select * from test where object_id = 100;
Explained.
SQL> select * from table(dbms_xplan.display());
14 rows selected.
Execution Plan
----------------------------------------------------------
Plan hash value: 2137789089
---------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 8168 | 16336 | 29 (0)| 00:00:01 |
| 1 | COLLECTION ITERATOR PICKLER FETCH| DISPLAY | 8168 | 16336 | 29 (0)| 00:00:01 |
---------------------------------------------------------------------------------------------
Statistics
----------------------------------------------------------
14 recursive calls
12 db block gets
55 consistent gets
0 physical reads
0 redo size
1414 bytes sent via SQL*Net to client
519 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
14 rows processed
经过排查,发现是在使用explain plan for之前执行过set autotrace on,关闭autotrace后执行计划就显示正常,一点小知识,记录以供参考。
: