title: Simple string comparison condition makes query run longer
body: <p>Query #1 from the code below at the very first run takes 1-2 seconds to execute, second and further runs under 0.1 second. Meanwhile queries #2 and #3 always execute within 0.1 - 0.2 seconds. Is there any explanation for this behaviour? I would understand if it was vice versa because of false condition in #1.</p>
  <p>I am not providing execute plan yet because that view is a bit complicated and not sure that plan itself would help. But I will if it's indeed required</p>
  <h1>1</h1>
  <pre><code>SELECT
  doc_id, line_num, load_id, ord_qty
  FROM someview v
  WHERE doc_id = 2987541 and 'A'='X' and v.iter_num = 
  (select max(iter_num) from someview where doc_id=v.doc_id);
  </code></pre>
  <h1>2</h1>
  <pre><code>SELECT
  doc_id, line_num, load_id, ord_qty
  FROM someview v
  WHERE doc_id = 2987541 and v.iter_num = 
  (select max(iter_num) from someview where doc_id=v.doc_id);
  </code></pre>
  <h1>3</h1>
  <pre><code>SELECT
  doc_id, line_num, load_id, ord_qty
  FROM someview v
  WHERE doc_id = 2987541 and 'X'='X' and v.iter_num = 
  (select max(iter_num) from someview where doc_id=v.doc_id);
  </code></pre>