Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sol.ctr.columbia.edu!srcsip!msi-s0.msi.umn.edu!umeecs!heavy From: heavy@zip.eecs.umich.edu (Richard Scott Hall) Newsgroups: comp.sys.atari.st.tech Subject: Data file indexing Summary: Need a way to index data fro retrieval and listing Keywords: Data Indexing Message-ID: <1990Sep21.152926.28515@zip.eecs.umich.edu> Date: 21 Sep 90 15:29:26 GMT Sender: Richard Hall ( heavy@zip.eecs.umich.edu ) Distribution: all Organization: University of Michigan EECS Dept., Ann Arbor, MI Lines: 23 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