title: Index not used due to type conversion?
body: <p>I have a process that is performing badly due to full table scans on a particular table. I have computed statistics, rebuilt existing indices and tried adding new indices for this table but this hasn't solved the issue.</p>
  
  <p>Can an implicit type conversion stop an index being used? What about other reasons? The cost of a full table scan is around 1000 greater than the index lookup should be.</p>
  
  <p>EDIT:</p>
  
  <p>SQL statement:</p>
  
  <pre><code>select unique_key 
  from src_table 
  where natural_key1 = :1 
  and natural_key2 = :2 
  and natural_key3 = :3;
  </code></pre>
  
  <ul>
  <li>Cardinality of natural_key1 is high, but there is a type conversion.</li>
  <li>The other parts of the natural key are low cardinality, and bitmap indices are not enabled.</li>
  <li>Table size is around 1,000,000 records.</li>
  </ul>
  
  <p>Java code (not easily modifiable):</p>
  
  <pre><code>ps.setLong(1, oid);
  </code></pre>
  
  <p>This conflicts with the column datatype: varchar2</p>