VIEW1 IS:
SELECT A, B, C FROM view2
UNION ALL
SELECT A, B, C FROM view3
INNER JOIN TBL5 ON view3.CODE = TBL5.CODE
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 SELECT * FROM VIEW1
and then applying the predicates after the fact.
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.