title: How can I get Oracle to use indexes when my view contains a UNION ALL?
body: <p>VIEW1 IS:</p>
  
  <pre><code>SELECT A, B, C FROM view2
  UNION ALL
  SELECT A, B, C FROM view3
    INNER JOIN TBL5 ON view3.CODE = TBL5.CODE
  </code></pre>
  
  <p>Column C is indexed in the source tables, and when I execute either of the select statements individually it uses the index and comes back in a flash.  When I use the view it times out.  I was under the impression that Oracle rewrote queries against views and used indexes where useful rather than doing a <code>SELECT * FROM VIEW1</code> and then applying the predicates after the fact.</p>
  
  <p>What am I doing wrong?  The sample views above illuminate the issue but my real views each join dozens of tables so a view is really necessary.</p>