On Wed, 22 Jan 2003, Mihael Knezevic wrote:
>
> one further question: as far as i understood the userspace object, it is
> one piece of memory i could use and not broke down to rows and columns.
> so how would one do a fast, keyed lookup?
>

User spaces aren't keyed like databases are... they are simply a big chunk
of bytes that you can use for your own purposes.    Really, this is what
makes them faster than databases -- the fact that you don't have the extra
complexity and overhead of having keyed access paths.

I'm still recommending to you that you use a database file.   It's much
easier to code, and I don't think you'll notice a performance difference.
Especially with only 15000 records to process.

If you must find a "more efficient" way to do keyed lookups, what you
probably want is a "user index" (not a user space) which is a lot like a
database, but has less overhead and therefore more raw speed.

Otherwise, I'd load the data into an array and use the %lookup BIF.  You
can using basing pointers to base that array in a user space if it makes
you happy (I don't know what that would accomplish, tho)

Finally, you could write your own "keyed access" routines for a user
space.  I doubt that this would outperform the database, though... unless
you put a LOT of effort into it and spent a lot of time optimizing it...
The easiest way would be to sort the data in the user space, and search it
using a "b-tree" type algorithm...   but I really wouldn't go this route,
myself...




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.