Share
BOX8 | SQL Query
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Assume the name of table and columns
There are two tables with a common column. Which one will take more processing time
-Outer Join
– Full Outer Join
– Cartesian Join
Answers ( 4 )
Cartesian Join
In my perspective cartesian join should take maximum processing time
as it always multiplies the no of rows in both the tables to get the final output.
Suppose, table 1 has 10 rows and table 2 has 20 rows, with 5 rows common.
Cartesian join will give 10*20 = 200 rows.
Full outer join will give (10 + 20 – 5) = 25 rows(Left outer + Right Outer – inner).
Left outer join will give 10 and Right Outer will give 20 rows.
This is a scenario when you are generally matching on some columns which
are acting as primary key or have unique values.
If all the values in the columns which you are matching are same, then probably,they
would all take the same time as they would produce the same output.
Cartesian Join as it is a cross product
Cartesian Join will take more time , it is a cross product of two columns.