[Q]Populating magma with a large tree

Chris Muller afunkyobject at yahoo.com
Tue Sep 2 16:22:51 UTC 2003


--- afunkyobject <afunkyobject at yahoo.com> wrote:
> --- In squeak at yahoogroups.com, Martin Drautzburg 
> <martin.drautzburg at w...> wrote:
> These are probably simple ones, but I could not quite figure them out.
> 
> But I want the magma database to be much larger than what I ever want
> to hold in memory. How can that be done ?

You only reference the portion of the tree that you need at any given time.


> Another related issue I don't quite understand is the following: if I
> want an index on the tree nodes I have to add them to a
> MagmaCollection, right ? 

Right, unless you have another indexing mechanism.  However, you can also
access objects by oid, but I wouldn't recommend it (poor practice).

> Suppose I have the database built and no
> object is currently in memory. Then i manage to materialize one tree
> node (assume it is a leaf) and delete it.

By "delete" I assume you mean to remove it from that tree..

> I will have to remove it
> from the MagmaCollection too, right ? 

If you wish the MagmaCollection to be "in-sync" with the Tree, yes.

> But is it in there at all ? I
> could have materialized the leaf object by traersing the tree from the
> root object without ever using the index.

A MagmaCollection is just like any other Collection in terms of referencing
objects, so yes, it is in there.  If you added your node to an
OrderedCollection then it would be in your Tree as well as the
OrderedCollection.  Removing the node from your Tree would not remove it from
the OrderedCollection, and it would not be gc'd, since it is still referenced
by the OrderedCollection.

Sharing objects.  No problem.

 - Chris


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the Squeak-dev mailing list