title: Oracle right Index to avoid full table scan
body: <p>I have the following query that yields around 10M records and it is doing a full table scan impacting our upstream applications. Can you please suggest an optimal index on following columns that would avoid a full table scan. Or if there is a better way to write this to avoid a full table scan.</p>
  <pre><code>select * 
  from qt.ORDERS r 
  where r.id = (
      select max(cr.id) 
      from qt.ORDERS cr 
      where cr.id = r.id)
    AND r.idtype&lt;&gt;3)
  </code></pre>