SQL*Plus: Release 9.2.0.1.0 - Production on 星期三 2月 15 22:24:00 2010
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
连接到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> create table a as select * from dba_objects ;
表已创建。
SQL> create index a_ix on a(owner , object_type) ;
Index created
SQL> explain plan for select * from a where owner = 'SYS' and object_type ='TABLE' ;
Explained
SQL> select * from table(dbms_xplan.display) ;
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | | | |
| 1 | TABLE ACCESS BY INDEX ROWID| A | | | |
|* 2 | INDEX RANGE SCAN | A_IX | | | |
---------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("A"."OWNER"='SYS' AND "A"."OBJECT_TYPE"='TABLE')
Note: rule based optimization
15 rows selected
SQL> explain plan for select * from a where object_type ='TABLE' and owner = 'SYS' ;
Explained
SQL> select * from table(dbms_xplan.display) ;
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | | | |
| 1 | TABLE ACCESS BY INDEX ROWID| A | | | |
|* 2 | INDEX RANGE SCAN | A_IX | | | |
---------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("A"."OWNER"='SYS' AND "A"."OBJECT_TYPE"='TABLE')
Note: rule based optimization
15 rows selected
SQL>