heavy@zip.eecs.umich.edu (Richard Scott Hall) (09/21/90)
I am writing a point-of-sale system and need some advice. I have an inventory file with appoximately 7000 records in it and I need a way to retrieve and list records in order quickly. Right now I have created a separate index file which basically is a binary search tree of the key fields. Each node in the index file has a key and a record number of the inventory record. This works great for retrieving, I do a quick binary tree search on the index file and get the record number, then I do a fseek in the inventory file and read the record; it is really quick, on the average about a second. The problem comes in when I try to list in sequence, I have modified the index file binary search tree so that it is linked to previous and next nodes in order, so that way I can just skip along the index file, but it is still slow to list because I have to fseek in the index file and in the inventory file for each record I list. This is painfully slow on machines without TOS 1.4. Is there a better way of doing this? I am will to scrap my whole model if someone has a better idea that satisfies both of my criterion... Thanks in advance, Richard Hall University of Michigan