473,394 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

SQL92 Join and DB2

I have an application that uses the old join syntax instead of the
SQL92 standards join syntax.
I need to justify changing the code to the new standard.
Is there any performance issue related to using the old syntax that
are documented?
Are there any other issues that I can use to justify a code upgrade?

Feb 1 '07 #1
7 5538
Version 8.2 and 9.1

Feb 1 '07 #2
dunleav1 wrote:
I have an application that uses the old join syntax instead of the
SQL92 standards join syntax.
I need to justify changing the code to the new standard.
Is there any performance issue related to using the old syntax that
are documented?
Are there any other issues that I can use to justify a code upgrade?
Do you mean implicit join syntax?
FROM T, S WHERE T.pk = S.FK
instead of
FROM T JOIN S ON T.pk = S.FK

There is no reason to change your code. DB2 does not differentiate
between the syntax and implicit joins are correct SQL standard syntax.
What you may want to avoid is mixing implicit join syntax with outer
join syntax for readability reasons.
When doing OUTER JOIN the ON clause gets evaluated before the WHERE
clause so throwing implicit join predicates in there may be confusing..

To sum it up: I don't see the justification.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Feb 1 '07 #3
On Feb 1, 11:09 am, Serge Rielau <srie...@ca.ibm.comwrote:
dunleav1 wrote:
I have an application that uses the old join syntax instead of the
SQL92 standards join syntax.
I need to justify changing the code to the new standard.
Is there any performance issue related to using the old syntax that
are documented?
Are there any other issues that I can use to justify a code upgrade?

Do you mean implicit join syntax?
FROM T, S WHERE T.pk = S.FK
instead of
FROM T JOIN S ON T.pk = S.FK

There is no reason to change your code. DB2 does not differentiate
between the syntax and implicit joins are correct SQL standard syntax.
What you may want to avoid is mixing implicit join syntax with outer
join syntax for readability reasons.
When doing OUTER JOIN the ON clause gets evaluated before the WHERE
clause so throwing implicit join predicates in there may be confusing..

To sum it up: I don't see the justification.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Yes - implicit join syntax
So the SQL92 Outer join syntax isn't faster or anything.

My issue is my application supports IBM DB2, Oracle, Sql Server, and
Mysql. Eveything is written in Java and the db access is through jdbc.
So having different standards accross vendor database and accross my
different product offerings could be confusing for developers.
Thanks,
JD
Feb 1 '07 #4
dunleav1 wrote:
On Feb 1, 11:09 am, Serge Rielau <srie...@ca.ibm.comwrote:
>dunleav1 wrote:
>>I have an application that uses the old join syntax instead of the
SQL92 standards join syntax.
I need to justify changing the code to the new standard.
Is there any performance issue related to using the old syntax that
are documented?
Are there any other issues that I can use to justify a code upgrade?
Do you mean implicit join syntax?
FROM T, S WHERE T.pk = S.FK
instead of
FROM T JOIN S ON T.pk = S.FK

There is no reason to change your code. DB2 does not differentiate
between the syntax and implicit joins are correct SQL standard syntax.
What you may want to avoid is mixing implicit join syntax with outer
join syntax for readability reasons.
When doing OUTER JOIN the ON clause gets evaluated before the WHERE
clause so throwing implicit join predicates in there may be confusing..

To sum it up: I don't see the justification.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

Yes - implicit join syntax
So the SQL92 Outer join syntax isn't faster or anything.
Now you are talking bout OUTER join syntax.
Note that e.g. DB2 doesn't even have a non standard OUTER join syntax.
Let me try to distill this down:
Do not use (+) in Oracle or *= in SQL Server.
Oracle describes in their SQL Reference some of the funny semantics of
(+) ...

If you support more than one product then you hurt yourself with non
portable SQL.

from a DB2 perspective explicit INNER JOIN vs. implicit inner join makes
no diff whatsoevere. But I can't speak for Oracle or SQL server.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Feb 1 '07 #5
On Feb 1, 12:35 pm, Serge Rielau <srie...@ca.ibm.comwrote:
dunleav1 wrote:
On Feb 1, 11:09 am, Serge Rielau <srie...@ca.ibm.comwrote:
dunleav1 wrote:
I have an application that uses the old join syntax instead of the
SQL92 standards join syntax.
I need to justify changing the code to the new standard.
Is there any performance issue related to using the old syntax that
are documented?
Are there any other issues that I can use to justify a code upgrade?
Do you mean implicit join syntax?
FROM T, S WHERE T.pk = S.FK
instead of
FROM T JOIN S ON T.pk = S.FK
There is no reason to change your code. DB2 does not differentiate
between the syntax and implicit joins are correct SQL standard syntax.
What you may want to avoid is mixing implicit join syntax with outer
join syntax for readability reasons.
When doing OUTER JOIN the ON clause gets evaluated before the WHERE
clause so throwing implicit join predicates in there may be confusing..
To sum it up: I don't see the justification.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Yes - implicit join syntax
So the SQL92 Outer join syntax isn't faster or anything.

Now you are talking bout OUTER join syntax.
Note that e.g. DB2 doesn't even have a non standard OUTER join syntax.
Let me try to distill this down:
Do not use (+) in Oracle or *= in SQL Server.
Oracle describes in their SQL Reference some of the funny semantics of
(+) ...

If you support more than one product then you hurt yourself with non
portable SQL.

from a DB2 perspective explicit INNER JOIN vs. implicit inner join makes
no diff whatsoevere. But I can't speak for Oracle or SQL server.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Serge,
I believe we are in agreement but let me give you an example about
what I referring to:
sql89: select tab1.col1 from tab1,tab2 where tab1.col1=tab2.col and
tab1.col1 >1;
sql92: select tab1.col1 from tab1 inner join tab2 on
tab1.col1=tab2.col2 where tab1.col1 >1;
Is there a performance impact using one syntax over the other?

I agree it is a good idea to not use proprietary sql extensions such
as (tab1(+) for Oracle or Mssql *=).

Feb 1 '07 #6
sql89: select tab1.col1 from tab1,tab2 where tab1.col1=tab2.col and
tab1.col1 >1;
sql92: select tab1.col1 from tab1 inner join tab2 on
tab1.col1=tab2.col2 where tab1.col1 >1;
Is there a performance impact using one syntax over the other?
In DB2: none whatsoever.

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Feb 1 '07 #7
On Feb 1, 1:29 pm, Serge Rielau <srie...@ca.ibm.comwrote:
sql89: select tab1.col1 from tab1,tab2 where tab1.col1=tab2.col and
tab1.col1 >1;
sql92: select tab1.col1 from tab1 inner join tab2 on
tab1.col1=tab2.col2 where tab1.col1 >1;
Is there a performance impact using one syntax over the other?

In DB2: none whatsoever.

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Thanks.

Feb 1 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: B. Fongo | last post by:
I learned MySQL last year without putting it into action; that is why I face trouble in formulating my queries. Were it a test, then you would have passed it, because your queries did help me...
2
by: Bruce Duncan | last post by:
I'm a bit new to MySQL (know MS SQL well...and that may be the problem...getting the syntax confused) and I'm having a join problem...can anyone offer some help? Here's my problem: I have table1...
3
by: Ike | last post by:
Oh I have a nasty query which runs incredibly slowly. I am running MySQL 4.0.20-standard. Thus, in trying to expedite the query, I am trying to set indexes in my tables. My query requires four...
1
by: Beachvolleyballer | last post by:
hi there anyone had an idea to join following 2 queries to 1???? ----- QUERY 1 --------------------------------------------- SELECT TMS_CaseF_2.Name AS TCDomain_0, TMS_CaseF_3.Name AS...
8
by: Matt | last post by:
Hello I have to tables ar and arb, ar holds articles and a swedish description, arb holds descriptions in other languages. I want to retreive all articles that match a criteria from ar and...
7
by: Greg | last post by:
I'm a quantitative securities analyst working with Compustat data (company fiscal reports and pricing feeds). My coworker came across a problem that we fixed, but I'd like to understand 'why' it...
12
by: Phil Powell | last post by:
<cfquery name="getAll" datasource="#request.dsn#"> SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn, U.choiceId, U.experience, T.label AS teamLabel, R.label AS roleLabel FROM User U...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
6
by: dunleav1 | last post by:
I have an application that uses the old join syntax instead of the SQL92 standards join syntax. I need to justify changing the code to the new standard. Is there any performance issue related to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.