日期:2014-05-17  浏览次数:20894 次

怎么开启Execution Plan?
SQL code

SQL> select * from
2 (
3 select a.*, rownum as rn from css_bl_view a
4 where capture_phone_num = '(1) 925-4604800'
5 ) b
6 where b.rn between 6 and 10;
6 rows selected.
Execution Plan
----------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2770 Card=2183 Bytes =7166789)
1 0 VIEW (Cost=2770 Card=2183 Bytes=7166789)
2 1 COUNT
3 2 TABLE ACCESS (FULL) OF 'CSS_BL_VIEW' (Cost=2770 Card=2183
Bytes=1305434)
Statistics
----------------------
0 recursive calls
0 db block gets
29346 consistent gets
29190 physical reads
0 redo size
7328 bytes sent via SQL*Net to client
234 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
5 rows processed
==========================================================================================================
如上所示的EXPLAIN_PLAN是怎么显示出来的?
新手,多谢指教



------解决方案--------------------
有三种方法:

1.Explain plan
explain plan for 
select * from aa;
查看结果:
select * from table(dbms_xplan.display()); 

2.Autotrace
Set timing on --记录所用时间
Set autot trace --自动记录执行计划

3.SQL_TRACE
ORACLE SQL_TRACE

“SQL TRACE”是Oracle提供的用于进行SQL跟踪的手段,是强有力的辅助诊断工具。在日常的数据库问题诊断和解决中,“SQL TRACE”是非常常用的方法。
------解决方案--------------------
楼上说的正确,看楼主的情况,可能是登录时自动执行了打开语句