[CC150v5] 11.4 Sort 20GB File - Shuatiblog.com
Imagine you have a 20 GB file with one string per line.
Explain how you would sort the file.
Solution
Use External Sort.
First divide the file into chunks which are x megabytes each, where x is the amount of memory we have available.
Each chunk is sorted separately and then saved back to the file system.
Once all the chunks are sorted, we then merge the chunks, one by one.
Read full article from [CC150v5] 11.4 Sort 20GB File - Shuatiblog.com
No comments:
Post a Comment