Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Which is faster join or sub query why

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
sattar_engg
Warnings : 1

New User


Joined: 23 Sep 2006
Posts: 4
Location: SE

PostPosted: Wed Jan 10, 2007 3:41 pm    Post subject: Which is faster join or sub query why
Reply with quote

Hi,
I have faced some question from a interviewer i could not answer few can you please answer them.

1. Which sort is faster ie Internal or External and why?
2. which is faster join or sub query why?
3. Can we open empty PS or empty VSAM file .

abdul sattar

WARNING: TITLE CHANGED
Back to top
View user's profile Send private message

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Wed Jan 10, 2007 5:12 pm    Post subject: Re: Interview Questions
Reply with quote

Quote:
1. Which sort is faster ie Internal or External and why?

External sort is faster than internal sort.For example if there are 1 million records as input and by external sort you reduce the record count to 500 and then send it to process ,similar situation in case of internal sort you pass the 1 million input record to process A and get 500 as output count.Then external sort will be preferable.


Quote:
3. Can we open empty PS or empty VSAM file .

You can open an empty PS .In case of VSAM,you can't open it as empty but initializing the VSAM using VSAMINIT will make it open .


Please Correct me if i am wrong.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 11, 2007 9:07 am    Post subject:
Reply with quote

Hello,

For the sorting part ONLY the external sort will usually perform better than the internal sort. Often the requirement is to select some information, sort it, then report on it. If the amount of data is small, running 1 COBOL step with an internal sort will perform better than the 3step (get,sort,report) process.

Depending on your shop standards, there may be more to document/turnover if you use the external sort. Two programs plus a sort step.

If you're sorting a a hundred million records, you most likely do not want an internal sort. . . .
Back to top
View user's profile Send private message
Santoshdorge

New User


Joined: 27 Jun 2006
Posts: 48
Location: Pune

PostPosted: Thu Jan 11, 2007 12:25 pm    Post subject:
Reply with quote

Join is efficient than the subquery So join is faster then the subquery.
Efficient in the sense time and resource usage.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us