function base index

create table t1(id number, idd varchar2(10));
insert into t1 values( 1, '11');
insert into t1 values(2, '22');


commit;




SQL> create index idx_idd_t1 on t1(to_number(idd));


Index created.


SQL> select * from t1 where idd='11';


     ID IDD
---------- ----------
      1 11




Execution Plan
----------------------------------------------------------
Plan hash value: 3617692013


--------------------------------------------------------------------------
| Id  | Operation       | Name | Rows  | Bytes | Cost (%CPU)| Time      |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |     1 |    20 |     2   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| T1      |     1 |    20 |     2   (0)| 00:00:01 |
--------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


   1 - filter("IDD"='11')


Note
-----
   - dynamic sampling used for this statement (level=2)


SQL>  select * from t1 where to_number(idd)=11;


     ID IDD
---------- ----------
      1 11




Execution Plan
----------------------------------------------------------
Plan hash value: 1463967975


------------------------------------------------------------------------------------------
| Id  | Operation              | Name      | Rows  | Bytes | Cost (%CPU)| Time      |
------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT         |           |     1 |    33 |     2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| T1      |     1 |    33 |     2   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN         | IDX_IDD_T1 |     1 |      |     1   (0)| 00:00:01 |
------------------------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


   2 - access(TO_NUMBER("IDD")=11)


Note
-----
   - dynamic sampling used for this statement (level=2)






SQL> select * from  t1 where to_number(idd)=to_number('11');


     ID IDD
---------- ----------
      1 11




Execution Plan
----------------------------------------------------------
Plan hash value: 1463967975


------------------------------------------------------------------------------------------
| Id  | Operation              | Name      | Rows  | Bytes | Cost (%CPU)| Time      |
------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT         |           |     1 |    33 |     2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| T1      |     1 |    33 |     2   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN         | IDX_IDD_T1 |     1 |      |     1   (0)| 00:00:01 |
------------------------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


   2 - access(TO_NUMBER("IDD")=11)


Note
-----
   - dynamic sampling used for this statement (level=2)






SQL> select * from  t1 where to_number(idd)=to_number('11');


     ID IDD
---------- ----------
      1 11




Execution Plan
----------------------------------------------------------
Plan hash value: 1463967975


------------------------------------------------------------------------------------------
| Id  | Operation              | Name      | Rows  | Bytes | Cost (%CPU)| Time      |
------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT         |           |     1 |    33 |     2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| T1      |     1 |    33 |     2   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN         | IDX_IDD_T1 |     1 |      |     1   (0)| 00:00:01 |
------------------------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


   2 - access(TO_NUMBER("IDD")=11)


Note
-----
   - dynamic sampling used for this statement (level=2)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值