title: sql server-query optimization with many columns
body: <p>we have "Profile" table with over 60 columns like (Id, fname, lname, gender, profilestate, city, state, degree, ...).</p>
  
  <p>users search other peopel on website. query is like :</p>
  
  <pre><code>WITH TempResult as (        
  select ROW_NUMBER() OVER(ORDER BY @sortColumn DESC) as RowNum, profile.id from Profile 
  where 
     (@a is null or a = @a) and
     (@b is null or b = @b) and
     ...(over 60 column)
  )
  SELECT profile.* FROM TempResult join profile on TempResult.id = profile.id
  WHERE 
       (RowNum &gt;= @FirstRow)
       AND 
       (RowNum &lt;= @LastRow)
  </code></pre>
  
  <p>sql server by default use clustered index for execution query. but total execution time is over 300. we test another solution such as multi column index in all columns in where clause but total execution time is over 400.
  do you have any solution to make total execution time lower than 100.
  we using sql server 2008.</p>