Adam Lally wrote:
On 2/8/07, Eddie Epstein <[EMAIL PROTECTED]> wrote:
-TypeSystem: t2 and t3 derive from t1
-User defined sorted index exists for t3
-fs of type t2 added to index -> causes bag index for t2 to be created
-fs of type t1 added to index -> causes bag index for t1 to be created.


It could make sense that for these
types there is no reason for an iterator over t1 to include instances
of t2, which would be the case for your alternative solution.

That doesn't make sense to me.  Instances of t2 *are* also instances
of t1, according to the usual concept of inheritance.  I think an
iterator that's supposed to return all instances of t1 had better also
return instances of all subtypes of t1.

-Adam

I agree with Adam that an iterator needs to return all instances as defined via the inheritance hierarchy.

So here's another proposal, sort of amalgamating what Adam and Eddie have said. We implement a special kind of bag index just for this purpose, and kind of bag index that users can not define. Such a bag index is a regular bag index, except that it only indexes FSs of *exactly* the index type, not subtypes. We continue to create such indexes lazily, as is currently done.

When it comes time to iterate over all indexed FSs, we do the inheritance manually, at iteration time. That's a little more code than is there now, but I don't think it's a big deal. I would still need to investigate how hard it is to implement the special bag index; not too hard I should hope, but the index implementation is pretty terrible (I'm allowed to say this as I wrote most of it myself).

--Thilo

Reply via email to