title: Query is very slow when we put a where clause on the total selected data by query
body: <p>I am running a query which is selecting data on the basis of joins between 6-7 tables. When I execute the query it is taking 3-4 seconds to complete. But when I put a <code>where</code> clause on the fetched data it's taking more than one minute to execute. My query is fetching large amounts of data so I can't write it here but the situation I faced is explained below:</p>
  
  <pre><code>Select Category,x,y,z
  from 
  (
  ---Sample Query
  ) as a
  </code></pre>
  
  <p>it's only taking 3-4 seconds to execute. But </p>
  
  <pre><code>Select Category,x,y,z
  from 
  (
  ---Sample Query
  ) as a
  where category Like 'Spart%'
  </code></pre>
  
  <p>is taking more than 2-3 minutes to execute.</p>
  
  <p>Why is it taking more time to execute when I use the <code>where</code> clause?</p>