IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Join V/S Sub Query - which one is more Efficient


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Fri Jan 19, 2007 6:22 pm
Reply with quote

Hi Guys,

I want to know among the JOIN and Sub Query in DB2 which one is more Efficient and which one uses the minimal no.of resources ...

Thanks,
Sasi Patha
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Jan 19, 2007 11:45 pm
Reply with quote

Sasi,

Not enough information.

It really depend on how the JOIN or Sub query are implemented. Either could be better or not.

For a determination you would have to supply the SQL, Table definitions, and indexes
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Mon Jan 22, 2007 12:05 pm
Reply with quote

Hi Sasi,

I assume you are asking about the diffrence between a Join and an exists check for a matching record..

From the feedbacks I ve got from DBA's, it seems an EXISTS check is better if do not require a column from the table to be selected. But if you need a column from the table to be selected, better to use JOIN.

Please let me know if I am not answering your question.

Thx,
Prajesh
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top