LISTING 1: Query with implicit function skips index

SQL> create table t ( x char(1) primary key );
Table created.

SQL> insert into t values ( '5' );
1 row created.


SQL> set autotrace on explain

SQL> select * from t where x = 5;
no rows selected


Execution Plan
--------------------------------------------
   0      SELECT STATEMENT Optimizer=CHOOSE
   1    0   TABLE ACCESS (FULL) OF 'T'

SQL> select * from t where x = '5';
no rows selected


Execution Plan
-----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=CHOOSE