title: SQL Server : optimize query with many 'and like' statements
body: <p>Let's say you have the query:</p>
  
  <pre><code>select columnA, columnB, columnC, columnD
  from tableA
  where columnA like '%hello%' and columnB like '%error%';
  </code></pre>
  
  <p>What's a good way to index a table for multiple and like conditions?</p>
  
  <p>Do you need an index with both columnA and columnB pointing to columnC and columnD </p>
  
  <p>or </p>
  
  <p>do you need columnA pointing to B, C, D and columnB pointing to A, C, D. </p>
  
  <p>I'm unsure which would be more helpful to the optimizer here.... </p>