You're right, such a search facility would be very nice. A somewhat (though perhaps not too terribly, depending on the structure of your data) painful approach is to combine multiple logical records (what are currently represented as individual records) into single physical records. This would probably be feasible as long as the logical records didn't very often change size during normal operations, and if it were rarely necessary to insert or delete logical records at internal positions. Unlimited internal insertions would, of course, lead to B-Tree-type splitting operations, at which point you might as well be implementing your own file system.
My company has perhaps the prototypical example of this situation: a read-only database. We concatenate as many logical records as possible into a single Palm Database record, until we hit the 65K size limit. At 04:55 PM 3/12/2002 -0500, Laurie Davis wrote: >I have used a binary search whenever it was possible. The search >that I am currently trying to >perform is on data that cannot be sorted. I need to do a >calculation on data that is in the >database to see if it meets the criteria. I cannot do any >pre-calculations since I do not >know what the search criteria will be beforehand. > >My suspicion is that I am stuck with the linear search, but I >was hoping that someone >had come up with something clever. You could presumably bypass >the database routines and >index through the database, but that would probably be extremely >dangerous. > >It would be very nice if the OS provided a routine to search the >entire database for a match >based on a user defined callback routine (such as is done for >the sorting routines). -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
