sql-server-2008joinsql-execution-planinner-query

is same execution plan means same performance?


I have two queries for the same task

ONE:

select * from table1 t1 
INNER JOIN table2 t2 
ON t1.id=t2.id

TWO

select * from table1 t1 
INNER JOIN (select * from table2) t2 
ON t1.id=t2.id

I checked the execution plan for both the queries.Both execution plans are same.But i doubt ,is there any difference in both the queries? If yes which one is more efficient?


Solution

  • There is no difference. You don't have any extra conditions in inner query. It is a straight select from table. Same happens in the background.