1.Ê×ÏÈÐèÒª½¨Á¢plan table,·ñÔò²»ÄÜʹÓÃ
½¨Á¢·½·¨£º
$oracle\rdbms\adminÏÂÓиö
utlxplan.sql
ÆäÄÚÈÝΪ:
create table PLAN_TABLE (
statement_id varchar2(30),
timestamp date,
remarks varchar2(80),
operation varchar2(30),
options varchar2(255),
object_node varchar2(128),
object_owner varchar2(30),
object_name varchar2(30),
object_instance numeric,
object_type varchar2(30),
optimizer varchar2(255),
search_columns number,
id numeric,
parent_id numeric,
position numeric,
cost numeric,
cardinality numeric,
bytes numeric,
other_tag varchar2(255),
partition_start varchar2(255),
partition_stop varchar2(255),
partition_id numeric,
other long,
distribution varchar2(30),
cpu_cost numeric,
io_cost numeric,
temp_space numeric,
access_predicates varchar2(4000),
filter_predicates varchar2(4000));
ÔËÐдËSQL
SQL>$ORACLE/rdbms/admin/utlxplan.sql
2.ʹÓÃexplain plan forÓï¾ä½øÐÐÖ´Ðмƻ®·ÖÎö
SQL> explain plan for
2 select * from dual;
ÒѽâÊÍ¡£
³öÏÖÉÏÊö½á¹û£¬±íÃ÷·ÖÎöÍê±Ï£¬¿ÉÒԲ鿴
3.¿ÉÒԲ鿴ִÐмƻ®ÁË
select * from table(DBMS_XPLAN.display);
--------------------------------------------------------------------
| Id | Operation | Name