The best lookup/hash model?
The best lookup/hash model?
- Subject: The best lookup/hash model?
- From: "Svensson, Conny" <email@hidden>
- Date: Thu, 31 Jan 2002 11:50:11 -0800
I need to implement some semi-database engine. What is the best way to
represent a table? I need to be able to get a record from it fast by ID. Is
NSDictionary the way to go? Is it fast enough? It needs to support up to 10
000 records. How fast it objectForKey: in this situation? Is there a faster
solution? I assume hash table is the only way to do it, and if I have
understood it right NS Dictionary is a kind of hashtable. The relational
glue will be represented by my business logic. I would also like to be able
to look for fields inside a record, i.e. not only access the record by its
ID (key). I assume I need to keep separate hash tables for this, like
database indicies. This would represent joining two tables with a foreign
key.
Do you have any suggestions or comments to my thinking? Performance is
pretty important for me as it it needs to drive a UI in "real time". What is
your expriences with this kind of things?