Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set lines 200 pages 999
- col plan_table_output format a180
- drop table t1 purge;
- create table t1 (id integer, x varchar2(100));
- insert into t1 select rownum, 'x' || mod(rownum, 500) from dual connect by level <= 50000;
- create index t1_indx on t1(substr(x, 2, 3));
- exec dbms_stats.gather_table_stats(null, 't1', method_opt=>'for all columns size 1');
- exec dbms_stats.gather_table_stats(null, 't1', method_opt=>'for all hidden columns size 1');
- set feedback only
- select * from t1 where substr(x, 2, 3) = '123';
- set feedback on
- select * from table(dbms_xplan.display_cursor(null,null,format=>'typical'));
- --
- SQL_ID azsfzfr3w3br1, child number 0
- -------------------------------------
- select * from t1 where substr(x, 2, 3) = '123'
- Plan hash value: 3617692013
- --------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- --------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | | | 31 (100)| |
- |* 1 | TABLE ACCESS FULL| T1 | 100 | 1400 | 31 (4)| 00:00:01 |
- --------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 1 - filter(SUBSTR("X",2,3)='123')
- 18 rows selected.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement