Microsoft Windows [版本 6.1.7601] 版权所有 (c) Microsoft Corporation.保留所有权利. C:\Users\zhangzheng2 SQL :: Copyright (c) , , Oracle. All Rights Reserved. 连接到: Oracle - 64bit Production With the Partitioning, OLAP and Data Mining options SQL SQL> spool c:/exp…
查看Oracle执行计划的几种方法 一.通过PL/SQL Dev工具 1.直接File->New->Explain Plan Window,在窗口中执行sql可以查看计划结果.其中,Cost表示cpu的消耗,单位为n%,Cardinality表示执行的行数,等价Rows. 2.先执行 EXPLAIN PLAN FOR select * from tableA where paraA=1,再 select * from table(DBMS_XPLAN.DISPLAY)便可以看到oracle…
1.PL/SQL解释计划窗口 优点:方面 缺点:看到信息有限 2.explain_plan for 针对某个句子优化较方便 3.sqlplus Sqlplus里输入命令: set autotrace on select * from emp; 数据显示出来后,跟着执行计划: 这个语句的优点就是它的缺点,这样在用该方法查看执行时间较长的sql语句时,需要等待该语句执行成功后,才返回执行计划,使优化的周期大大增长. 如果不想执行语句而只是想得到执行计划可以采用: set autotrace trac…
也许有很多种方法,这里只是书上学到的一种方法 with a as ( order by grp_factor) t ) select b.id, a.grp_factor )b --use v$sqlarea to find out your query by searching with key words. this might --take a little bit long. select sql_id, sql_text from v$sqlarea where sql_text li…
一.ORACLE中常见执行计划 表访问的执行计划 1.table access full:全表扫描.它会访问表中的每一条记录. 2.table access by user rowid:输入源rowid来自于用户指定. 3.table access by index rowid:输入源rowid来自于索引. 4.table access by global index rowid:全局索引获取rowid,然后再回表. 5.table access by local index rowid:分区索…