title: INNER JOIN on Linked Server Table much slower than Sub-Query
body: <p>I came across this very odd situation, and i thought i would throw it up to the crowd to find out the WHY.</p>
  
  <p>I have a query that was joining a table on a linked server:</p>
  
  <pre><code>select a.*, b.phone
  from table_a a, 
  join remote.table_b b on b.id = a.id
   (lots of data on A, but very few on B)
  </code></pre>
  
  <p>this query was talking forever (never even found out the actual run time), and that is when I noticed <code>B</code> had no index, so I added it, but that didn't fix the issue.  Finally, out of desperation I tried:</p>
  
  <pre><code>select a.*, b.phone
  from table_a a, 
  join (select id, phone from remote.B) as b on b.id = a.id
  </code></pre>
  
  <p>This version of the query, in my mind as least, should have the same results, but lo and behold, its responding immediately!  </p>
  
  <p>Any ideas why one would hang and the other process quickly? And yes, I did wait to make sure the index had been built before running both.</p>