My Database Professor told us to use:
SELECT A.a1, B.b1 FROM A, B WHERE A.a2 = B.b2;
Rather than:
SELECT A.a1, B.b1 FROM A INNER JOIN B ON A.a2 = B.b2;
Supposedly Oracle don't likes JOIN-Syntaxes, because these JOIN-syntaxes are harder to optimize than the WHERE restriction of the Cartesian Product.
I can't imagine why this should be the case. The only Performance issue could be that the parser Needs to parse a few characters more. But that is negligible in my eyes.
I found this Stack Overflow Questions:
And this sentence in a Oracle Documentation: https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries006.htm
Oracle recommends that you use the FROM clause OUTER JOIN syntax rather than the Oracle join operator.
Can someone give me up-to-date recommendations from Oracle with link. Because she don't acknowledges StackOverflow (here can answer everyone) and the 10g Documentation is outdated in here eyes.
If i am wrong and Oracle realy don't likes JOINS now than thats also ok, but i don't find articles. I just want to know who is Right.
Thanks a lot to everyone who can help me!
Joins can also be performed by having several tables in the from clause, separated with commas , and defining the relationship between them in the where clause. This technique is called an Implicit Join (since it doesn't actually contain a join clause). All RDBMSs support it, but the syntax is usually advised against.
The implicit join syntax is “old-style” syntax, where each join operation is defined implicitly via the WHERE clause, using the so-called join columns (see the second statement in Example 6.57). Note – Use of the explicit join syntax is recommended. This syntax enhances the readability of queries.
Four types of joins: left, right, inner, and outer.
Basically, we have only three types of joins: Inner join, Outer join, and Cross join.
Your professor should speak with Gordon Linoff, who is a computer science professor at Columbia University. Gordon, and most SQL enthusiasts on this site, will almost always tell you to use explicit join syntax. The reasons for this are many, including (but not limited to):
FROM
and WHERE
clauses.Regarding performance, as far as I know, both versions of the query you wrote would be optimized to the same thing under the hood. You can always check the execution plans of both, but I doubt you would see a significant difference very often.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With