All good points. However, all I'm pointing out is whichever method you choose to sort/find the record, it is possible (and faster) to store the UID in the header - assuming you are happy with less room (3 bytes) to store them. On the other hand, if you go to the trouble of maintaining your own UID seeds, then why bother with the Palm ones, and checking to see if they have failed?
Matt > "Alan Ingleby" <[EMAIL PROTECTED]> wrote in message > > For fast access to a record in a sorted database, item is only O(log n), > so > where's the problem there anyway? Sure you have a (relatively) big > overhead > with memory semaphores etc, but the key feature of this solution is that > it's O(log n). Using a uniqueID is O(n), with a massively lower time > constant, but still O(n), so not suggested for databases with large record > counts. > If you make the decision that uniqueID is going to be the fastest way, > simple store your own uniqueID inside the record, (as I think you > suggested), but don't use it. Lookup the record with the PalmOS uniqueID, > then confirm that it's the record you want, before proceding. > Automatically > switch the a binary search for your internal uniqueID if the PalmOS > uniqueID > has failed you. This method gives you the best of both worlds. > Alan > "Matt Hebley" <[EMAIL PROTECTED]> wrote in message > news:93819@palm-dev-forum... > > > > I heard a rumour that there were even more "reserved" IDs that should > not > be > > used, but have yet to investigate... > > > > <sarcasm>Surely the reason for using unique IDs is to find records?! > > > > BTW, I didn't say it was fast, just that there was no (additional) speed > > hit. </sarcasm> > > > > Matt > > > > ----- Original Message ----- > > From: "Robert McKenzie" <[EMAIL PROTECTED]> > > To: "Palm Developer Forum" <[EMAIL PROTECTED]> > > Sent: Friday, August 16, 2002 2:05 AM > > Subject: RE: Uniqueness of UniqueIDs? > > > > > > You should note that if you want to store your own IDs in the Palm > record > > header that: > > > > (1) Current Palm record IDs are 24-bit, non-zero numbers, NOT 32 bit > > numbers. > > (2) This is subject to change. > > > > The only speed savings attained by puting IDs in the header is in > finding > > records by IDs. However, dmFindRecordByID uses a top down linear > search, > > thus is (for large DBs) pretty much pig slow anyway... > > > > -bob mckenzie, palmsource pdx > > > > -----Original Message----- > > From: Matt Hebley [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, August 14, 2002 5:01 PM > > To: Palm Developer Forum > > Subject: Re: Uniqueness of UniqueIDs? > > > > > > The problem as I understand it is the uniqueness of the IDs, i.e. that > the > > ID generator seeds are not maintained. If you are going to manage your > own > > ID generation, you can still use the Palm record header ID memory to > store > > your IDs rather than inside the records, then there is no speed hit. > > > > Matt > > > > ----- Original Message ----- > > From: "Sean Kennedy" <[EMAIL PROTECTED]> > > To: "Palm Developer Forum" <[EMAIL PROTECTED]> > > Sent: Thursday, August 15, 2002 10:20 AM > > Subject: Re: Uniqueness of UniqueIDs? > > > > > > > I have looked at all the links provided in this thread. I think that > > > this is an issue that Palm should clear up. If unique IDs really are > > > not guaranteed to be constant and unique, I am not sure what the > > > point of them are. > > > > > > The consensus seems to be that it is very very unlikely to run into a > > > duplicate unique ID or have a unique ID of a record change on you. > > > But apparently it can happen in some rare situations where there has > > > been a hard reset and a software restore. > > > > > > Since using a custom written "Unique ID" system is most likely going > > > to be slower, I have decided to both stick with Palm's unique ID > > > system and write my own. I will tag each record with my own unique > > > ID. However, until I run into any problem with Palm's unique ID > > > system, I am going to have my unique ID system remain dormant. If a > > > problem results, I will essentially be able to flip a switch and > > > start using my own unique IDs instead of Palm's built in unique IDs. > > > > > > Does anyone have any thoughts on this? > > > > > > -Sean Kennedy -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
