Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Difference in performance between the two queries below

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
venkagov

New User


Joined: 10 Aug 2006
Posts: 6
Location: Chennai

PostPosted: Fri Sep 22, 2006 11:19 am    Post subject: Difference in performance between the two queries below
Reply with quote

Hi,

Can anyone tell me will there be any difference in performance between the two queries below.

Query 1:

Select A.EMPNO,A.EMPNAME,A.DEPTNO,B.DEPTNAME
FROM EMP A,DEPT B
WHERE A.DEPTNO = B.DEPTNO

I think above query uses cartesian product.

Query 2:

Select A.EMPNO,A.EMPNAME,A.DEPTNO,B.DEPTNAME
FROM EMP A INNER JOIN DEPT B
ON A.DEPTNO = B.DEPTNO

Above query uses join.

Join is better than cartesian product right?

Let me know if I am wrong.

Also please tell me some way of comparing the perfomance of queries.
Back to top
View user's profile Send private message

anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Fri Sep 22, 2006 11:30 am    Post subject:
Reply with quote

query 1 and 2 are just the same. They represent inner join.
query 1 and 2 represent two equivalent syntax for performing inner join. when INNER JOIN is specified, the WHERE keyword is replaced with the ON keyword.
Back to top
View user's profile Send private message
anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Fri Sep 22, 2006 11:33 am    Post subject:
Reply with quote

Also, performance wise there is not going to be any difference.

Anamika
Back to top
View user's profile Send private message
venkagov

New User


Joined: 10 Aug 2006
Posts: 6
Location: Chennai

PostPosted: Fri Sep 22, 2006 11:47 am    Post subject: Re: Query Performance
Reply with quote

Thanks Anamika.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts CONTIG for performance? JPVRoff JCL & VSAM 8 Fri Jun 09, 2017 8:39 am
No new posts Need help with below queries ashek15 DB2 3 Thu Mar 23, 2017 1:38 am
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts BC, BCR, BRC, BRCL performance steve-myers PL/I & Assembler 0 Fri Dec 23, 2016 7:44 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us