Blocks: nested search
[1/2] from: robert::muench::robertmuench::de at: 6-Jan-2003 16:38
Hi, has someone done some library functions to use blocks as records?
I'm currently using name/value blocks for "database" releated things.
While the nested structure is quite nice it makes some "problems" in
that sometimes you want it to be nested in other way.
Example:
test: [a [a1 a2] b [b1 b2] c]
This works fine as long as I want to search for a, b or c. But what if I
now want to search for a1 or b2? Of course I can iterate through the
list... Not very efficient.
I'm thinking about using something like an index:
index: [a1 [a] a2 [a] b1 [b] b2 [b]]
What do you think? Any other ideas? Robert
[2/2] from: greggirwin:mindspring at: 6-Jan-2003 18:27
Hi Robert,
RMM> I'm thinking about using something like an index:
RMM> index: [a1 [a] a2 [a] b1 [b] b2 [b]]
Something like an index is a good idea. Consider a hash! for your
index to speed lookups. Gabriele's BTree might be another option worth
considering.
-- Gregg