SQL> analyze table mytest compute statistics;
Table analyzed.
SQL> select num_Rows from user_tables where table_name='MYTEST';
NUM_ROWS
----------
50000
SQL> select distinct_keys from user_indexes where index_name='IDX_A';
DISTINCT_KEYS
-------------
50000
SQL> set autotrace traceonly
SQL> select d from mytest
2 where a=10 and b=10 and c=10;
Execution Plan
----------------------------------------------------------
Plan hash value: 1542625214
--------------------------------------------------------------------------------
------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time
|
--------------------------------------------------------------------------------
------
| 0 | SELECT STATEMENT | | 1 | 16 | 2 (0)| 00:0
0:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| MYTEST | 1 | 16 | 2 (0)| 00:0
0:01 |
|* 2 | INDEX RANGE SCAN | IDX_A | 1 | | 1 (0)| 00:0
0:01 |
--------------------------------------------------------------------------------
------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("A"=10 AND "B"=10 AND "C"=10)
Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
4 consistent gets
0 physical reads
0 redo size
508 bytes sent via SQL*Net to client
492 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
SQL> select d from mytest
2 where b=500;
Execution Plan
----------------------------------------------------------
Plan hash value: 530004086
--------------------------------------------------------------------------------
------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time
|
--------------------------------------------------------------------------------
------
| 0 | SELECT STATEMENT | | 1 | 8 | 2 (0)| 00:0
0:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| MYTEST | 1 | 8 | 2 (0)| 00:0
0:01 |
|* 2 | INDEX RANGE SCAN | IDX_B | 1 | | 1 (0)| 00:0
0:01 |
--------------------------------------------------------------------------------
------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("B"=500)
Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
4 consistent gets
0 physical reads
0 redo size
508 bytes sent via SQL*Net to client
492 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
--------------------next---------------------
阅读(280) | 评论(0) | 转发(0) |