title: Why IsNull is twice slow as coalesce (same query)?
body: <p>We met a strange situation on SQL Server 2008 (SP1) - 10.0.2531.0 (X64) - Win2008 SP2 (X64).</p>
  
  <p>Here is a one heavy query:</p>
  
  <pre><code>select t1.id, t2.id 
  from t1, t2
  where 
       t1.id = t2.ext_id
       and isnull(t1.vchCol1, 'Null') = isnull(t2.vchCol1, 'Null')
       and isnull(t1.vchCol2, 'Null') = isnull(t2.vchCol2, 'Null')
       .... and about 10 more comparisons with Isnull
  </code></pre>
  
  <p><strong>UPD</strong>:  All columns in comparison (except IDs) are <code>varchar</code>(~30...200)<br>
  T1 is ~130mln rows, T2 is ~300k rows.</p>
  
  <p>These query on rather big Dev server run <strong>~5 hours</strong> - this is slow, but what we can do?</p>
  
  <p>And while we investigated possible ways of optimisation - we found, that changing <strong>"isnull"</strong> to <strong>"coalesce"</strong> in query above gives double performance gain - and query now run for <strong>~2 hours</strong></p>
  
  <p><strong>UPD</strong>: When we remove all <code>ISNULL</code> checks and use just <code>t1.vchCol1 = t2.vchCol1</code> the query finishes after <strong>40mins</strong>.</p>
  
  <p><em>Question is</em>: Is this known behavior and we should <strong>avoid</strong> using <em>IsNull</em> everywhere?</p>