1

I am joining two tables with half a million records each and this is the structure of both tables

A (AKey, Name)
B (BKey, AKey, Value, Set). 

Set is a bit type. No index on Set.

Is there any difference between these two queries?

SELECT Name, Value
FROM A
INNER JOIN B 
    ON A.AKey = B.Key 
    AND B.Set = 1

and

SELECT Name,Value
FROM A
INNER JOIN B
    ON A.Key = B.Key
WHERE B.Set = 1

These two return the same results. Might be a noob question but still a question.

James Z
  • 12,209
  • 10
  • 24
  • 44
user1429322
  • 1,266
  • 2
  • 24
  • 38
  • 2
    There should be no difference in performance but there would be a big difference in result if it would be a `left join` for instance – juergen d Aug 09 '15 at 11:15
  • What were the results of your own personal tests? – Dan Bracuk Aug 09 '15 at 11:27
  • @Dan The execution plans for the data set that I used did not give much difference in performance. This data set might increase. That is why I want to use the query that is better – user1429322 Aug 09 '15 at 11:29

0 Answers0