Professional Documents
Culture Documents
20 rows selected.
,Function based Index
4.cursor_sharingforce,
SQL> select substr(object_name,3,6) from t1 where object_id=20000;
SUBSTR(OBJEC
-----------565853
SQL> alter session set cursor_sharing=force;
Session altered.
SQL> select object_name,object_id from t1
2 where substr(object_name,3,6)='565853';
OBJECT_NAME OBJECT_ID
------------------------------ ---------/25658537_StoreInstruction 20000
/25658537_StoreInstruction 39336
SQL> select substr(object_name,3,6) from t1 where object_id=30000;
SUBSTR(OBJECT_NAME,3,6)
-----------------------------------------------------------6d7f7a
SQL> select object_name,object_id from t1
2 where substr(object_name,3,6)='6d7f7a';
OBJECT_NAME OBJECT_ID
19 rows selected.
5.hint,index,
SQL> select /*+INDEX(t1_fidx t1)*/ object_name,object_id from t1
2 where substr(object_name,3,6)='6d7f7a';
OBJECT_NAME OBJECT_ID
------------------------------ ---------/86d7f7a5_ProfileErrorsText_el 30000
/86d7f7a5_ProfileErrorsText_el 49335
SQL> select sql_id,sql_text from v$sqlarea where
2 sql_text like 'select % from t1 where substr%';
SQL_ID
------------SQL_TEXT
-------------------------------------------------------------------------------------------------------------9hnjcn7h3t35d
select /*+INDEX(t1_fidx t1)*/ object_name,object_id from t1 where substr(object_name,:"SYS_B_0",:"SYS_B_1")=:"
SYS_B_2"
fyt5sd2rt1zv6
select object_name,object_id from t1 where substr(object_name,3,6)='ER_ADV'
6w6hd3w7ju6v9
select object_name,object_id from t1 where substr(object_name,:"SYS_B_0",:"SYS_B_1")=:"SYS_B_2"
SQL_ID
------------SQL_TEXT
--------------------------------------------------------------------------------------------------------------
19 rows selected.
6.cursor_sharingexact,hint,hint,function based index
SQL> alter session set cursor_sharing=exact;
Session altered.
SQL> select substr(object_name,3,6) from t1 where object_id=40000;
SUBSTR(OBJEC
-----------b93801
SQL> select /*+INDEX(t1_fidx t1)*/ object_name,object_id from t1
2 where substr(object_name,3,6)='b93801';
OBJECT_NAME OBJECT_ID
------------------------------ ---------/7b938016_ProtocolVersion 20664
/7b938016_ProtocolVersion 40000
SQL> select sql_id,sql_text from v$sqlarea where
2 sql_text like 'select % from t1 where substr%';
SQL_ID
------------SQL_TEXT
-------------------------------------------------------------------------------------------------------------bbhcgkhrysz5s
select /*+INDEX(t1_fidx t1)*/ object_name,object_id from t1 where substr(object_name,3,6)='b93801'
9hnjcn7h3t35d
select /*+INDEX(t1_fidx t1)*/ object_name,object_id from t1 where substr(object_name,:"SYS_B_0",:"SYS_B_1")=:"
SYS_B_2"
fyt5sd2rt1zv6
select object_name,object_id from t1 where substr(object_name,3,6)='ER_ADV'
SQL_ID
------------SQL_TEXT
-------------------------------------------------------------------------------------------------------------0uywm521n21jj
select sql_id,sql_text from v$sqlarea where sql_text like 'select % from t1 where substr%'
6w6hd3w7ju6v9
select object_name,object_id from t1 where substr(object_name,:"SYS_B_0",:"SYS_B_1")=:"SYS_B_2"
20 rows selected.