title: Oracle not using index, Entity Framework & Devart DotConnect for oracle
body: <p>The table in question has ~30mio records. Using Entity Framework I write a LINQ Query like this:</p>
  <pre><code>dbContext.MyTable.FirstOrDefault(t =&gt; t.Col3 == &quot;BQJCRHHNABKAKU-KBQPJGBKSA-N&quot;);
  </code></pre>
  <p>Devart DotConnect for Oracle generates this:</p>
  <pre><code>SELECT
  Extent1.COL1,
  Extent1.COL2,
  Extent1.COL3
  FROM MY_TABLE Extent1
  WHERE (Extent1.COL3 = :p__linq__0) OR ((Extent1.COL3 IS NULL) AND (:p__linq__0 IS NULL))
  FETCH FIRST 1 ROWS ONLY
  </code></pre>
  <p>The query takes about four minutes, obviously a full table scan.</p>
  <p>However, handcrafting this SQL:</p>
  <pre><code>SELECT
  Extent1.COL1,
  Extent1.COL2,
  Extent1.COL3
  FROM MY_TABLE Extent1
  WHERE Extent1.COL3 = :p__linq__0
  FETCH FIRST 1 ROWS ONLY
  </code></pre>
  <p>returns the expected match in 200ms.</p>
  <p>Question: Why is it so? I would expect the query optimizer to note that the right part is false if the parameter is not null, so why doesn't the first query hit the index?</p>