Board index » delphi » Sorting a file of records
jbr...@echidna.cowan.edu.au (John Breen)
![]() Delphi Developer |
Sat, 25 Jul 1998 03:00:00 GMT
|
jbr...@echidna.cowan.edu.au (John Breen)
![]() Delphi Developer |
Sat, 25 Jul 1998 03:00:00 GMT
Sorting a file of records
I am working on a database management program, and want to be able to
sort records in the data file on a multi-key sort. At present, I am implementing a quicksort algorithm, which can sort 1000 records of 83 bytes in just over a minute. Unfortunately, the database may run up to a million records, and the sort time of over an hour is prohibitive. The application is to run on a base-level 286 (640K RAM), and the sort Cheers, JB -- |
Termenix knocks them dead so they don't get
![]() Delphi Developer |
Sun, 26 Jul 1998 03:00:00 GMT
Re:Sorting a file of recordsQuoteIn article <jbreen.823575...@bluering.cowan.edu.au>, jbr...@echidna.cowan.edu.au (John Breen) writes: particularily if they are sitting at a terminal waiting for a response. Therefor, I recomend that you don't sort them at all!! The best way to get away with this is to store them in sorted order. There are a couple ways to do this. If that is not an option then... If that sounds like a bunch of hooie then try this... Of course there is also the COTS solution... And a wild idea that I don't know if it can happen And another wild one.. Hope these help.. |
Chris Ryde
![]() Delphi Developer |
Sun, 26 Jul 1998 03:00:00 GMT
Re:Sorting a file of recordsQuotejbr...@echidna.cowan.edu.au (John Breen) wrote: is already sorted (or pretty near in order) it runs _really_ slow. Beware of where you take the comaparison key from. Take it from the middle of the portion to be sorted to ensure that sorting an already ordered database isn't too slow. I guess you know all this as you've already got QS implemented. If you know the type of data you're sorting on is all of a similar type Quote>The application is to run on a base-level 286 (640K RAM), and the sort You don't need an effecient sorting algorithm, you need a magician! Best of luck, ChrisR: |
JUD MCCRAN
![]() Delphi Developer |
Mon, 27 Jul 1998 03:00:00 GMT
Re:Sorting a file of records JB> I am working on a database management program, and want to be able to JB> The application is to run on a base-level 286 (640K RAM), and the sort You are probably going to need a disk merge-sorting method. It It can probably be done in less than an hour on the 286 (for 1 I could wrte it for you, but it would be involved enough that Jud McCranie jud.mccra...@swsbbs.com |
1. Help with sorting a file of records
2. Fast copying records in sorted order / was Sorting
3. how do i sort records in files
5. Sorting of records in binary file..
6. SORTING RECORDS-NON TEXT FILES
8. Most efficient sort text file routine, sort algorithms