View previous topic :: View next topic
|
Author |
Message |
adrianlmk
New User
Joined: 02 Jan 2008 Posts: 11 Location: Malaysia
|
|
|
|
Hi, I have a query on the performance perspective
I have 10 huge file (length 8092 VB and each file got 10 million record)
I need to merge all these file to a single file with a key (e.g. 10,5,CH,A)
I have 2 option to do this.
First
i can concatenate all these file by using SORTIN & SORTOUT SYSIN = SORT FILEDS=(10,5,CH,A)
Second
I can use SORTIN01, SORTIN02........SORTIN10 & SORTOUT SYSIN = MERGE FILEDS=(10,5,CH,A) --- because all this 10 file already pre-sorted with this keys.
May i know which method is better in term of PERFORMANCE.
Thanks |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Well, let's think about it.
Your first proposed solution would re-sort a large number of records that had been sorted, except that you strung them together via concatenate, thereby totally unsorting the whole shebang (I'm not sure of the origin of this technical term).
Your 2nd solution takes already sorted files and then just interleaves them, each loop taking the lowest ranking top record from one of the ten files.
Hmmmmmm. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
In general, a MERGE is more efficient than a SORT.
However, why not try doing both yourself and see which one is more efficient yourself. That's always the best way to answer a question like that. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Frank Yaeger wrote: |
In general, a MERGE is more efficient than a SORT.
|
Is it another tidbit from You... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yes, but a pretty well known one. Sorting is more complex than merging and generally requires the use of more resources. For example, a SORT may require the use of intermediate storage (e.g. hiperspace or work space) whereas a MERGE never does. |
|
Back to top |
|
|
adrianlmk
New User
Joined: 02 Jan 2008 Posts: 11 Location: Malaysia
|
|
|
|
Hi everyone, thanks for giving me a lot of comment and suggestion. I think I got the answer that I want.. Thanks for your help |
|
Back to top |
|
|
|