I have this query
select col1,col2, x.id pk
/*+ INDEX (some_index_on_col4)*/
from tbl1 y
,tbl2 x
where col2 = 'some_value' and col3 = 'U'
and x.col4 = dbms_lob.substr( REPLACE(y.PK_DATA,'"',''), 100, 1 )
;
the query is very slow, and when I explain the plan, it shows that the index is not used but a full table scan is used instead, if I remove
dbms_lob.substr( REPLACE(y.PK_DATA,'"',''), 100, 1 )
and say instead
x.col4 = 3456
it's working fine, how can I enhance this?
N.B. : tbl2 is partitioned