排序的文本文件有超过亿条记录 [英] Sorting a text file with over 100,000,000 records

查看:122
本文介绍了排序的文本文件有超过亿条记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要按照字母顺序进行排序一个5gig文本文件 什么是使用最好的算法?

I have a 5gig text file that needs to be sorted in alphabetical order What is the best algorithm to use?

约束:

速度 - 尽可能快

记忆 - 一个装有1千兆拉姆运行Windows XP

Memory - A Pc with 1 Gig Ram running windows XP

推荐答案

我经常文本文件> 2GB与排序 linux命令。通常需要15 - 30秒后​​,根据服务器的负载。

I routinely sort text files >2GB with the sort linux command. Usually takes 15 - 30 seconds, depending on server load.

只要做到这一点,它不会需要,只要你想。

Just do it, it won't take as long as you think.

更新由于您使用的是Windows XP,你可以在 sort命令UnxUtils 的。我使用的一个可能比Linux版本越多,它也同样快。

Update Since you're using Windows XP, you can get the sort command in UnxUtils. I use that one probably more than the linux version, and it's equally as fast.

对于大文件真的对磁盘速度的瓶颈问题..我的服务器上面有一个快速SATA RAID。如果你的机器是台式机或笔记本电脑,那么你的7200转(或5400)RPM IDE驱动器将在几分钟添加到作业。

The bottleneck for huge files really disk speed .. my server above has a fast sata raid. If your machine is a desktop (or laptop), then your 7200 RPM (or 5400) RPM IDE drives will add a few minutes to the job.

这篇关于排序的文本文件有超过亿条记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆