[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object query language?



On Sat, 18 Mar 2000, William Uther wrote:
> Hi,
>   It is not clear to me that Ozone should provide special indexing 
> functionality.  Sure, you could have Ozone index objects according to some 
> attribute, but you'd then have to specify what attributes to index by, and 
> would have to choose an indexing data structure, etc.
> 
>   This is exactly the reason the ODMG bindings include collection classes 
> (although they are currently incomplete in Ozone).  
You can use any collection classes in ozone. In fact, ODMG collections have
exactly the same interface as java.util collection.

> You are supposed to be 
> able to build and use your own indicies very easily.
This is exactly the point.

> 
>   In your case, why don't you put the objects into a Map indexed by their 
> name?  That map might be a hashtable or a tree or whatever you think will 
> suit you best.
> 
>   Of course, this model for indexing means that either you have to make the 
> name another Ozone object (and use an ozone object as the key in a 
> hashtable, which doesn't work currently), Or you have to store the name 
> twice (once in the object and once in the key you are hashing by), Or you 
> roll your own hashtable class specifically for this index (yuk!).  ODMG 
> seems to prefer the first option - everything in the DB is a proxied object 
> and can be used everywhere a normal object might be.

Is this the reason that let you try to use proxies as keys, Will - avoid to
store the key value twice if it is also a direct attribute? I don't recommend
using proxies as keys for that reason. In most cases it should be no problem to
sync the index with the attribute values of the indexed objects. In worst case
you can rebuild the entire index when needed. This is much faster *and* less
space consuming (although you avoid doubling the key) than haveing millions of
10 byte objects stored in the database.


Falko
-- 
______________________________________________________________________
Falko Braeutigam                         mailto:falko@softwarebuero.de
softwarebuero m&b (SMB)                    http://www.softwarebuero.de