----创建一张表echo----
SQL> create table echo as select * from dba_objects;
Table created.
SQL> set autotrace trace exp;
SQL> set linesize 150;
SQL> select * from echo where object_id=1000;
Execution Plan
----------------------------------------------------------
Plan hash value: 642657756
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 12 | 2484 | 289 (1)| 00:00:04 |
|* 1 | TABLE ACCESS FULL| ECHO | 12 | 2484 | 289 (1)| 00:00:04 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("OBJECT_ID"=1000) ----因为表echo没有创建索引,执行计划没有选择数据访问路径的余地,谓词条件在这里只是起到数据过滤的作用,所以使用了filter。
Note
-----
- dynamic sampling used for this statement (level=2)
----创建索引的情况----
SQL> create index echo_ind on echo(object_id);
Index created.
SQL> create table echo as select * from dba_objects;
Table created.
SQL> set autotrace trace exp;
SQL> set linesize 150;
SQL> select * from echo where object_id=1000;
Execution Plan
----------------------------------------------------------
Plan hash value: 642657756
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 12 | 2484 | 289 (1)| 00:00:04 |
|* 1 | TABLE ACCESS FULL| ECHO | 12 | 2484 | 289 (1)| 00:00:04 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("OBJECT_ID"=1000) ----因为表echo没有创建索引,执行计划没有选择数据访问路径的余地,谓词条件在这里只是起到数据过滤的作用,所以使用了filter。
Note
-----
- dynamic sampling used for this statement (level=2)
----创建索引的情况----
SQL> create index echo_ind on echo(object_id);
Index created.