From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,14bff0642983a2a5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-30 07:55:43 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: sorting large numbers of large records Date: 30 Jul 2003 07:55:40 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0307300655.2ad33d81@posting.google.com> References: NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1059576942 30459 127.0.0.1 (30 Jul 2003 14:55:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 30 Jul 2003 14:55:42 GMT Xref: archiver1.google.com comp.lang.ada:41014 Date: 2003-07-30T14:55:42+00:00 List-Id: Hyman Rosen wrote in message news:... > Keith Thompson wrote: > > If you're using GNU sort, the length of each line can be unlimited; > > So there :-) > > > Finally, I'm not sure what GNU sort (or any other Unix-like sort) does > > with input too big to fit into memory; > > As far as I know, UNIX sort has always been able to sort arbitrarily large > files by doing what I suggested in an earlier message - sort pieces of the > original into temporary files, then merge them together. Actually, since these are fixed size records, you could do a sort by simply exchanging record values on disk. You have random access via Direct_IO. You could also map the entire file, to view it as one large array. In either case you could use a generic algorithm (the one in Charles would be adequate) to do the work.