title: Index on view (Oracle)
body: <p>Lets say I have two tables, <code>tab_a</code> and <code>tab_b</code>.</p>
  
  <p>And I create a view like the following:</p>
  
  <pre><code>create view join_tabs as
  (
    select col_x as col_z from tab_a
    union
    select col_y as col_z from tab_b
  );
  </code></pre>
  
  <p>And if I do the following:</p>
  
  <pre><code>select * from join_tabs where col_z = 'BLAH';
  </code></pre>
  
  <p>If <code>tab_a</code> indexes <code>col_x</code> and <code>tab_b</code> indexes <code>col_y</code>, we should be able to do this with two index searches.</p>
  
  <p>However, it would be nice if I could make an index over both tables in one index, or even index the view, in a way that automatically updates immediately if the source tables (<code>tab_a</code> or <code>tab_b</code>) change.</p>
  
  <p>Is there a way to do this in Oracle?</p>