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-28 16:43:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!cyclone-sf.pbi.net!216.218.192.242!news.he.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread4.news.pas.earthlink.net.POSTED!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada References: Subject: Re: sorting large numbers of large records X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <9yiVa.1765$Bg.1522@newsread4.news.pas.earthlink.net> Date: Mon, 28 Jul 2003 23:43:01 GMT NNTP-Posting-Host: 65.110.133.134 X-Complaints-To: abuse@earthlink.net X-Trace: newsread4.news.pas.earthlink.net 1059435781 65.110.133.134 (Mon, 28 Jul 2003 16:43:01 PDT) NNTP-Posting-Date: Mon, 28 Jul 2003 16:43:01 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:40914 Date: 2003-07-28T23:43:01+00:00 List-Id: "Brien L. Christesen" wrote in message news:bg3fgg$qig$1@grapevine.wam.umd.edu... > > > I couldn't really find much discussion of doing external sorts in Ada (or > much literature on external sorts at all) so I'm not sure if this is a > good approach to be taking, or if there is a better way to do the sort. I > tried creating an index, sorting the index, and then creating the results > file based on the index. Jumping around the file with direct_io led to > awful results, though. The execution time of the part of the code that > read the index, got the corresponding value from the large record file, > and wrote that record to a new file grew exponentially. > > Does anyone know of a good way to do this kind of sort? Thanks in advance > for any responses. I forgot to mention that I also wrote both indexed i/o and indexed sequential i/o containers. These might be useful for minimizing how many elements are kept in main memory. (The indexed i/o files are implemented using a B-tree.) http://www.adapower.com/reuse/indexed_io.html -Matt