title: Slow SQL Query due to inner and left join?
body: <p>Can anyone explain this behavior or how to get around it?</p>
  
  <p>If you execute this query:</p>
  
  <pre><code>select * 
  from TblA
  left join freetexttable ( TblB, *, 'query' ) on TblA.ID = [Key]
  inner join DifferentDbCatalog.dbo.TblC on TblA.ID = TblC.TblAID
  </code></pre>
  
  <p>It will be very very very slow.</p>
  
  <p>If you change that query to use two inner joins instead of a left join, it will be very fast.  If you change it to use two left joins instead of an inner join, it will be very fast.</p>
  
  <p>You can observe this same behavior if you use a sql table variable instead of the freetexttable as well.  </p>
  
  <p>The performance problem arises any time you have a table variable (or freetexttable) and a table in a different database catalog where one is in an inner join and the other is in a left join.</p>
  
  <p>Does anyone know why this is slow, or how to speed it up?</p>