I was using a method similar to yours, but I had the requirement of populating a multi-column list (custom, of course) with data from two
different databases. The code was easy to write, but searching for unique ID's must do a linear search because there is no way for the data manager to know if the unique ID's are in any type of order. Anyway, this was slowing the scrolling aspect of my list once I hit 200+ records.
My solution was to use an indexing method. I am not going to go in to great detail unless you are really interested in them. The limitation of the way I did things is that I end up halving the total number of records that you can store in a single database. Actually, I artificially limit it to 30,000 records. You could get around this but it would make things a bit more complicated.
The idea behind my scheme is to store sort tables (index tables) that refer to the physical record index in the PDB file. The index tables remain locked for the life of the object (class) so there is no overhead of using the index tables. However, accessing a record causes one extra level of indirection because I need to get the record index from the index table and then go to that record in the database. I don't see great performance hits doing it this way. In order to ensure that the physical record indexes do not change for the life of the database, I handle insertions and deletions myself.
Doing this allows me to store the physical record index of B in record A. So, if I need to display a table with info from record A and B, I don't have to do any more searching once I have found record A. When showing the data in a list that needs to elegantly scroll, this method works great and I am not really even searching for record A because in most cases I am using Database A's index table and moving through it sequentially.
Anyway, I could go in to much greater detail as to how I actually do all of this is you are interested.
Let me know,
Brad
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
