title: SQL query takes too long to run in SSMS
body: <p>I've the following query which works absolutely fine in Oracle developer</p>
  <pre><code>select TRIM(a.filterh) 
  from CHANNEL a,GENRE b
  where b.label = 'M001CL01_ABC' 
    and a.s_r_id = b.r_id 
    and a.filterh in (select c.filterh 
                      from CHANNEL c, GENRE d 
                      where d.label = 'M001AL03' and c.s_r_id = d.r_id)
  </code></pre>
  <p>I just tried to simplify the above query and some syntax change for SQL developer and the below query takes a lot of time to run in SSMS</p>
  <pre><code>select TRIM(a.filterh) 
  from CHANNEL a 
  inner join GENRE b on a.s_r_id = b.r_id
  where b.label = 'M001CL01_ABC' 
    and a.filterh in (select c.filterh 
                      from CHANNEL c
                      inner join GENRE d on c.s_r_id = d.r_id
                      where d.label = 'M001AL03')
  </code></pre>
  <p>I just wish to understand what am I doing wrong here, how can I improve my query and why the SQL query takes a lot of time.</p>
  <p>Thank you.</p>