View previous topic :: View next topic
|
Author |
Message |
sattar_engg Warnings : 1 New User
Joined: 23 Sep 2006 Posts: 5 Location: SE
|
|
|
|
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 |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
Join is efficient than the subquery So join is faster then the subquery.
Efficient in the sense time and resource usage. |
|
Back to top |
|
|
|