title: Optimize Select Query
body: <p>I am using SQL 2000, and I am running a simple select statement on a table containing about 30 million rows. The select query looks like:</p>
  
  <pre><code>select col1, col2, col3 from Table1 where col4=@col4 and col5=@col5 and col6=@col6
  </code></pre>
  
  <p>The table has a clustered index in it (i.e. a primary key), but that is not being used as a where criteria. All the where criterias mentioned above have no indexed in them.</p>
  
  <p>How can I optimize this query?</p>
  
  <p>If I add indexes for each column in the where clause, would that make any difference?</p>
  
  <p>If I have 10 columns in where clause, should all of those 10 columns have index in them?</p>
  
  <p><strong>Edit:</strong> This is probably one of the most common interview question :)</p>