LINQ: Where vs Join

It is very important to understand difference between WHERE and JOIN operation.

WHERE is actually create a Cartesian product, meaning if you working on two tables (Table1 has 100 rows and Table2 has 1000 rows), WHERE condition will evaluates on 100*1000 rows.

In contrary JOIN will takes rows from Table1 and will take only matching rows (by defined condition) from the Table2 which is obviously much efficient.

Leave a Reply

Your email address will not be published. Required fields are marked *