Possible Duplicate:
Explicit vs implicit SQL joins
I want to know the difference in performance of
select * from A,B,C where A.x = B.y and B.y = C.z
and
select * from A INNER JOIN B on A.x = B.y INNER JOIN C on B.y = C.z
Basically i want to know if inner join performs better than cartesian product? Also, in inner join is cartesian product carried out internally?
First of All these two Operations are for Two different purposes , While Cartesian Product provides you a result made by joining each row from one table to each row in another table. while An inner join (sometimes called a simple join ) is a
join of two or more tables that returns only those rows that satisfy the join condition.
Now coming to what You have Written here :
In case of Cartesian product First A table comprising of A,B,C is created and after that on the basis of what ever condition is given,we Get result. But as you see it's heavy process.
On the other hand Inner join only chooses those result which are really fulfilling the given condition .Hence it's a better solution for achieving end results.
First one is abuse of SQL language.