title: Query runs slow when NVL is used in Oracle
body: <p>I have a view when I query this view it runs slow. However if I remove NVL function it is running fast.</p>
  
  <p>I have checked execution plan, when NVL function is used it is not using any index. If NVL function is not used it is index. I tried to specify the index as hint but it did not help. Not sure whether the hint is considered or not while executing. </p>
  
  <p>Below is the view and the query used to create the view.</p>
  
  <pre><code>CREATE OR REPLACE FORCE VIEW  "test"(a,b)
  select NVL(table1.a,table2.a) a,table2.b from table1 join table2 on table1.id=table2.id 
  </code></pre>
  
  <p>The query that I am using on view is </p>
  
  <pre><code>select * from test where a='XYZ'
  </code></pre>
  
  <p>Any thoughts what should I do to make above query run fast?</p>